Ejemplo n.º 1
0
S3E_MAIN_DECL int main()
{
    s3eBool available = FortumoAvailable();
    
	Fortumo_SetLoggingEnabled(true);
	
    while(!s3eDeviceCheckQuitRequest()) {
        s3eDeviceYield(0);
        s3ePointerUpdate();
        s3eDebugPrint(0, 30, (available) ? "Fortumo (OK)" : "Fortumo (ERR)", 0);
        s3eSurfaceShow();
        
        if(available && (s3ePointerGetState(S3E_POINTER_BUTTON_SELECT) & S3E_POINTER_STATE_PRESSED)) {
            Fortumo_PaymentRequest *request = Fortumo_PaymentRequest_Create();
            
            Fortumo_PaymentRequest_SetDisplayString(request, "display_string_here");
            Fortumo_PaymentRequest_SetService(request, "service_id_here", "app_secret_here");
            Fortumo_PaymentRequest_SetProductName(request, "product_name_here");
            Fortumo_PaymentRequest_SetConsumable(request, true);
            Fortumo_MakePayment(request, &Fortumo_OnPaymentComplete, NULL);
            Fortumo_PaymentRequest_Delete(request);
        }
    }
    
    return 0;
}
Ejemplo n.º 2
0
//--------------------------------------------------------------------------
// Main global function
//--------------------------------------------------------------------------
S3E_MAIN_DECL void IwMain()
{
#ifdef EXAMPLE_DEBUG_ONLY
	// Test for Debug only examples
#endif
	onInit();
	while (1)
	{
		s3eDeviceYield(0);
		s3eKeyboardUpdate();
		bool result = onUpdate();
		if (
			(result == false) ||
			(s3eKeyboardGetState(s3eKeyEsc) & S3E_KEY_STATE_DOWN)
			||
			(s3eKeyboardGetState(s3eKeyLSK) & S3E_KEY_STATE_DOWN)
			||
			(s3eDeviceCheckQuitRequest())
			) {
			break;
		}
		onRender();
		s3eSurfaceShow();
	}
	onShutDown();
}
Ejemplo n.º 3
0
// Main entry point for the application
int main()
{
	int i = 0;
	bool hidden = false;
	bool adsAvailable = false;
	bool noView = false;

	if(AdmobAdsAvailable()){
		InitAds("a14bd815ee70598");
		adsAvailable = true;
	}

		
    // Wait for a quit request from the host OS
    while (!s3eDeviceCheckQuitRequest())
    {
        

		// Fill background blue
        s3eSurfaceClear(0, 0, 255);

        // Print a line of debug text to the screen at top left (0,0)
        // Starting the text with the ` (backtick) char followed by 'x' and a hex value
        // determines the colour of the text.
        s3eDebugPrint(120, 150, "`xffffffHello, World!", 0);

		if (noView){
			s3eDebugPrint(120, 190, "`xff1111No view", 0);
		}else{
			s3eDebugPrint(120, 190, "`x11ff11Ok", 0);
		}

        // Flip the surface buffer to screen
        s3eSurfaceShow();

        // Sleep for 0ms to allow the OS to process events etc.
        s3eDeviceYield(1);

		if(adsAvailable){
			i++;

			if(i>15000){
				i = 0;
				if (hidden) {
					noView = ShowAds() != 0;
				} else {
					noView = HideAds() != 0;
				}

				hidden = !hidden;
			}
		}

		s3eKeyboardUpdate();
		if(s3eKeyboardGetState(s3eKeyBack) & S3E_KEY_STATE_DOWN){
			break;
		}
    }
    return 0;
}
void HelloWorldRender()
{
	s3eDebugPrint(120, 150, "`x000000Hello, World!", 0);
	createButton("Exit");
	buttonStatus = "Exit";
	s3eSurfaceShow();
}
// Main entry point for the application
int main()
{
	message = "`xffffff";

	if (s3ePushWooshNotificationsAvailable())
	{
		s3ePushWooshRegister(S3E_PUSHWOOSH_REGISTRATION_SUCCEEDED, (s3eCallback)&OnPushRegistered, 0);
		s3ePushWooshRegister(S3E_PUSHWOOSH_MESSAGE_RECEIVED, (s3eCallback)&OnPushReceived, 0);
		s3ePushWooshRegister(S3E_PUSHWOOSH_REGISTRATION_ERROR, (s3eCallback)&OnPushRegisterError, 0);

		//s3ePushWooshNotificationRegister();
		const char* cstrApp = PW_APPID.c_str();
		s3ePushWooshNotificationRegisterWithPWAppID(cstrApp);
		s3ePushWooshStartLocationTracking();
		
		s3ePushWooshNotificationSetBadgeNumber(6);
				
		//Sample code for using local notifications
		//Currently this is available for Android only. You can use default Marmalade extension for iOS local notifications at this time.
		//s3ePushWooshClearLocalNotifications();
		
		//30 seconds for local notification to fire
		//s3ePushWooshScheduleLocalNotification("Your pumpkins are ready!", 30, 0);

		// postEvent example
		//s3ePushWooshSetUserId("${userId}");
		//s3ePushWooshPostEvent("testEvent", "{ \"attribute\" : \"value\" }");
	}

	// Wait for a quit request from the host OS
	while (!s3eDeviceCheckQuitRequest())
	{
		// Fill background blue
		s3eSurfaceClear(0, 0, 255);

		// Print a line of debug text to the screen at top left (0,0)
		// Starting the text with the ` (backtick) char followed by 'x' and a hex value
		// determines the colour of the text.
		s3eDebugPrint(120, 150, message.c_str(), 0);
		// else
		// 	s3eDebugPrint(120, 150, "`xffffffNot available :(", 0);

		// Flip the surface buffer to screen
		s3eSurfaceShow();

		// Sleep for 0ms to allow the OS to process events etc.
		s3eDeviceYield(0);
	}
	return 0;
}
Ejemplo n.º 6
0
// Helper function to display message for Debug-Only Examples
void DisplayMessage(const char* strmessage)
{
    uint16* screen = (uint16*)s3eSurfacePtr();
    int32 width     = s3eSurfaceGetInt(S3E_SURFACE_WIDTH);
    int32 height    = s3eSurfaceGetInt(S3E_SURFACE_HEIGHT);
    int32 pitch     = s3eSurfaceGetInt(S3E_SURFACE_PITCH);
    for (int y = 0; y < height; y++)
    for (int x = 0; x < width; x++)
        screen[y * pitch/2 + x] = 0;
    s3eDebugPrint(0, 10, strmessage, 1);
    s3eSurfaceShow();
    while (!s3eDeviceCheckQuitRequest() && !s3eKeyboardAnyKey())
    {
        s3eDeviceYield(0);
        s3eKeyboardUpdate();
    }
}
bool ExamplesMainUpdate() {
    s3eKeyboardUpdate();
    s3ePointerUpdate();

    if (!ExampleUpdate())
    {
        s3eDebugTracePrintf("ExampleUpdate returned false, exiting..");
        return false;
    }

    if (g_ClearScreen)
        s3eSurfaceClear(0xff,0xff,0xff);

    ExampleRender();
    ButtonsRender();
    SoftkeysRender();

    if (g_DrawCursor)
        CursorRender();

    s3eSurfaceShow();
    s3eDeviceYield(FRAMETIME);
    return true;
}