Posted: 22nd Dec 2011 18:11
I am in the process of porting/re building apps made for iOS to AppGameKit for its cross platform support.

AGK supports c++, now one thing that is handy about that is I can use regular coding job websites to hire c++ coders, but what I want to know is, does regular c++ work in AppGameKit, could I hire a c++ coder who knows nothing about AppGameKit, hire them to create an application, take the code, and just copy and paste into AppGameKit and it will work? Nothing more needs to be done, no drawbacks, no hidden flaws, no special lists of functions I need the coder to know about, or special files they need, or an extra hurdle for me to cross, just straight copy and paste the code into AppGameKit?

Sounds a bit good to be true. If it works it means I can hire any c++ coder, and just drop their code into AppGameKit and compile to multiple platforms. Sounds too easy, and in my experience, nothing is easy about making applications. Can someone inform me if their are any limitations here?
Posted: 22nd Dec 2011 21:28
The short answer: no

However, any C++ programmer could pick up AppGameKit rather quickly as I did. In my opinion, porting it to iOS or Android was more of a problem although not that much of a problem thanks to the good documentation provided and the excellent help from the boards.
Posted: 22nd Dec 2011 22:10
It was very easy for me to get the hang of AGK. But I come from DarkGdk.

A C++ coder will have knowledge of C, but still has to learn the AppGameKit command set, and start coding the "AGK way"

In your case, I would say it's better to opt for some other popular SDK where you will find a lot of 3rd world country programmers who are already versatile, on those infamous hiring sites!
Posted: 22nd Dec 2011 22:20
So not all C++ commands can be used? So there is a special set of c++ commands, or only some of the regular c++ commands can be used? If so where is it please.
Posted: 22nd Dec 2011 23:18
from my understanding, you are able to use the C++ language itself but also need various agk::Command (and other functions provided by TGC) to be able to use the various graphic, network and other commands available.

For loops, while loops, functions and all that good stuff is done in the way of C++ and you throw in the available agk command set too.
Posted: 23rd Dec 2011 0:12
Can anyone else please confirm this is true, also if this is true is the command set available to download?
Posted: 23rd Dec 2011 0:29
here is some of the cprogramming.com tutorials converted to AppGameKit that I did to start learning C++, it shows examples of the core C++ language that also uses the included AppGameKit command set that comes with AGK. These 3 examples compile and run on my android 2.3 device with no problems. hope this helps you out. I have not completed this tutorial series but if enough people want me to finish this series from cprogramming.com to AppGameKit, I can continue to work on it.

+ Code Snippet
/*
	Name:			cprogramming.com to AGK C++ While loop Tutorial
	Description:	Learning AGK Native C++ Tutorial
*/

// include our main header file
#include "Main.h"

// let the compiler know we're using the AGK namespace
using namespace AGK;

// declare our app
app App;


void app::Begin ( void )
{

	agk::SetVirtualResolution ( 320, 480 );

}

void app::Loop ( void )
{
	int x = 0;  // Don't forget to declare variables
	  
	  while ( x < 10 ) { // While x is less than 10 
	    agk::Print(x);
	    x++;             // Update x so the condition can be met eventually
	  }

	 agk::Sync ( );
}

void app::End ( void )
{

}


+ Code Snippet
/*
	Name:			cprogramming.com to AGK NATIVE C++ AGE IF Tutorial
	Description:	Learning AGK Native C++ Tutorial
*/

// include our main header file
#include "Main.h"

// let the compiler know we're using the AGK namespace
using namespace AGK;

// declare our app
app App;

int age;
char* age_char = NULL;

void app::Begin ( void )
{
	agk::SetVirtualResolution ( 320, 480 );

	agk::StartTextInput ( );
}

void app::Loop ( void )
{
	if ( agk::GetTextInputCompleted ( ) )
		age_char = agk::GetTextInput ( );	// Asks for age
		age = agk::Val(age_char);
	if ( age )
		if (age < 100) {	// If the age is less than 100
			agk::Print ( "You are pretty young" );	// Just to show you it works...
		}
		else if (age == 100 ) {	// I use else if just to show an example
			agk::Print("You are old");	// Just to show you it works...
		}
		else {
			agk::Print("You are really old");	// Executed if no other statement is
		}

	agk::Sync ( );
}

void app::End ( void )
{

}


+ Code Snippet
/*
	Name:			cprogramming.com to AGK NATIVE C++ For loop Tutorial
	Description:	Learning AGK Native C++ Tutorial
*/

// include our main header file
#include "Main.h"

// let the compiler know we're using the AGK namespace
using namespace AGK;

// declare our app
app App;


void app::Begin ( void )
{

	agk::SetVirtualResolution ( 320, 480 );

}

void app::Loop ( void )
{
	for ( int x = 0; x < 10; x++ ) {
		agk::Print(x);
	}

	 agk::Sync ( );
}

void app::End ( void )
{

}


btw, a suggestion for the forum. It would be great if we could preview our post before actually posting it to the forum, don't know if this is currently available as I don't see it.
Posted: 23rd Dec 2011 0:34
I'm not sure I fully understand the question, but b83 is correct. When using Tier 2 you use the native language (e.g., C/C++) commands for data types, conditional statements, loops, methods etc., and use the AppGameKit commands for the game-specific functions, such as sprite generation, particles, text display, collision, and so on.

So in Tier 1 basic you might use:

+ Code Snippet
If GetSpriteVisible(sprNum) = 0
    Print("Sprite isn't visible.")
Endif


But in Tier 2 it would instead be:

+ Code Snippet
if (agk::GetSpriteVisible(sprNum) == 0)
{
    agk::Print("Sprite isn't visible.");
}


If converting a native iOS app to pure AppGameKit (Tier 1) so it can readily be ported to other platforms, you'll have to use the AppGameKit Basic language (no C++).
Posted: 23rd Dec 2011 0:40
xCept, you explained it way better than I did Thanks. Is it possible to use existing 3rd party libraries written in C++ and use them with AppGameKit? or would those libraries need to be re-written in AppGameKit C++?
Posted: 23rd Dec 2011 0:58
There should be no problems using custom C++ libraries if coding in tier 2. In fact this is required if you want to support additional functionality for a particular platform etc., such as Game Center (for iOS).
Posted: 23rd Dec 2011 3:08
If converting a native iOS app to pure AppGameKit (Tier 1) so it can readily be ported to other platforms, you'll have to use the AppGameKit Basic language (no C++).


I am not sure what you are saying here, are you saying only AppGameKit Basic supports all the platforms, and C++ does not support all the platforms?
Posted: 23rd Dec 2011 5:13
No, you can get AppGameKit apps working on all platforms regardless of tier 1 (basic) or tier 2 (native / c++). However, it may not be as straightforward to compile tier 2 apps for multiple platforms since each platform has its own quirks regarding the app requirements (e.g., file structure, required includes, etc). All of the AppGameKit commands are identical across platforms and if you stick strictly to C++ as the core language it probably won't be so bad, especially if you use the included templates. It's when you develop using platform-specific components (e.g., objective-c commands for iOS) that it becomes more difficult translating to other platforms.

P.S., I should add that I only began playing around with AppGameKit a few weeks ago and haven't had much time to devote to it.
Posted: 23rd Dec 2011 11:29
Fallen One, your hired programmer has to learn AppGameKit to make games and apps using AGK. He cannot hand you standard c++ code, and you simply copy & paste it into agk, press compile and put it on the app store.
Posted: 23rd Dec 2011 16:07
your hired programmer has to learn AppGameKit to make games and apps using AGK. He cannot hand you standard c++ code, and you simply copy & paste it into agk, press compile and put it on the app store.


Looking at this
All of the AppGameKit commands are identical across platforms and if you stick strictly to C++ as the core language it probably won't be so bad


use the AppGameKit commands for the game-specific functions

It seems to say, if I have a list of the AppGameKit commands, my coder writes in c++ and uses the AppGameKit commands I give them, then I can indeed copy and paste their code into the app.

So then the question is where is this list for download?
Though we do have the problem that tier two is not available as a demo in the trail, so all testing has to go through me, that's very inconvenient
Posted: 23rd Dec 2011 19:09
Falled One, you are right, if your programmer has a list of all AppGameKit commands, he can write code BLINDLY, send you the code, and then you copy & paste, compile and do the testing!

However I doubt any decent programmer will want to work like that.

Good luck.
Posted: 23rd Dec 2011 19:21
No programmer can work like that, you need to test as you go. The closest you can get is if your programmer has a full license and so does the person translating into the other native languages.
Posted: 23rd Dec 2011 21:03
list of all AppGameKit commands


where can I find these please?

However I doubt any decent programmer will want to work like that.


Ive done it before in another program, its a nightmare, it takes so much time as I have to check their work.
Posted: 24th Dec 2011 17:20
http://www.appgamekit.com/documentation/commands.html
Posted: 24th Dec 2011 22:34
another question, do you need to use Objective-C when coding for iOS? can C++ be used on that platform? or is it Obj-C along with the AppGameKit Command set?

thanks.
Posted: 24th Dec 2011 22:43
When developing in AppGameKit you use c++

You can also use obj-c on ios to do things which agk does not support.