Game Development Reference
In-Depth Information
You will recall that we said that our Main.cpp file would reside in a directory called
source in the MKB file, so first create this new subdirectory in the project directory.
Now, create a file called Main.cpp in the source directory and enter the following
into it:
//---------------------------------------------------------
// Learning Mobile Game Development with Marmalade
// Chapter 1 - Hello
//---------------------------------------------------------
// Marmalade SDK includes
#include "IwGx.h"
#include "s3eConfig.h"
#include "s3eDevice.h"
//---------------------------------------------------------
// Main entry point
//---------------------------------------------------------
int main()
{
// Initialise Marmalade modules
IwGxInit();
// Set a default message, then check the ICF file to see if
// a proper message has been specified
char lMessage[S3E_CONFIG_STRING_MAX] = "Hello!";
s3eConfigGetString("APP", "Message", lMessage);
// Set screen clear colour to black
IwGxSetColClear(0, 0, 0, 255);
// Draw text at double default size
IwGxPrintSetScale(2);
// Loop until we receive a quit message
while (!s3eDeviceCheckQuitRequest())
{
// Allow device to process its internal events
s3eDeviceYield(0);
// Clear the screen
IwGxClear();
 
Search WWH ::




Custom Search