int main() { //s3eInetAddress addr; //memset(&addr, 0, sizeof(addr)); //s3eInetLookup("localhost", &addr, NULL, NULL); //addr.m_Port = s3eInetHtons(81); //s3eSocket* pSock = s3eSocketCreate(S3E_SOCKET_UDP, 0); //char szData[20000]; //for (int i=0; i <20000;++i) //{ // szData[i] = i; //} //while (true) //{ // int sent = s3eSocketSendTo(pSock, szData, 20000, 0, &addr); // s3eDeviceYield(0); //} s3eLocationStart(); //IwGx can be initialised in a number of different configurations to help the linker eliminate unused code. //For the examples we link in all of IwGx's possible functionality. //You can see the code size reduce if you remove any of the IwGxInit calls following IwGxInit_Base. //Note that, for demonstration purposes, some examples call IwGxInit() themselves - this will link in the //standard renderer and the GL renderer, so on those examples these features cannot be excluded from the build. //IwGxInit_Base(); //IwGxInit_GLRender(); IwGxInit(); Iw2DInit(); IwUIInit(); //Instantiate the view and controller singletons. //IwUI will not instantiate these itself, since they can be subclassed to add functionality. new CIwUIView; CIwUIController2* pController = new CIwUIController2; IwDebugTraceLinePrintf("Creating Game Object"); FireflyGameEngine* pGameEngine = new FireflyGameEngine; IwDebugTraceLinePrintf("Entering Main"); int result = GameMain(pGameEngine); delete pGameEngine; Iw2DTerminate(); delete IwGetUIView(); delete pController; IwUITerminate(); IwGxTerminate(); s3eLocationStop(); return result; }
bool CIwMapGame::IsGpsActive() { if (s3eLocationAvailable()) { s3eLocation loc; if (S3E_RESULT_SUCCESS == s3eLocationGet(&loc)) { return true; } } s3eLocationStart(); return false; }
//Example Main void ExampleInit() { InitMessages(10,60); g_ButtonLogEvent = NewButton("Log Event"); g_ButtonLogTimedEvent = NewButton("Log Timed Event"); g_ButtonEndTimedEvent = NewButton("End Timed Event"); g_ButtonLogError = NewButton("Log Error"); g_ButtonUserInfo = NewButton("Set User Info"); g_ButtonUserLocation = NewButton("Log User Location"); g_ButtonToggleSendOnClose = NewButton("Disable send session report on close"); g_ButtonToggleSendOnPause = NewButton("Disable send session report on pause"); g_ButtonSetDefaultMessage = NewButton("Set Default Banner Message"); g_ButtonToggleAdBanner = NewButton("Toggle Ad Banner"); g_ButtonShowOfferWall = NewButton("Display Offer Wall"); g_ButtonLogEvent->m_Enabled = false; g_ButtonLogTimedEvent->m_Enabled = false; g_ButtonEndTimedEvent->m_Enabled = false; g_ButtonLogError->m_Enabled = false; g_ButtonUserInfo->m_Enabled = false; g_ButtonUserLocation->m_Enabled = false; g_ButtonToggleSendOnClose->m_Enabled = false; g_ButtonToggleSendOnPause->m_Enabled = false; g_ButtonSetDefaultMessage->m_Enabled = false; g_ButtonToggleAdBanner->m_Enabled = false; g_ButtonShowOfferWall->m_Enabled = false; if (!s3eFlurryAvailable()) { AppendMessageColour(RED,"Extension Not Available"); return; } // Enable AppCircle // We need to call this *before* calling s3eFlurryStart s3eFlurryAppCircleEnable(); //iOS Applicaton Key if(s3eDeviceGetInt (S3E_DEVICE_OS) == S3E_OS_ID_IPHONE) s3eFlurryStart("DNWX7I7XZYYL9V1QAZFC"); //Android Applicaton Key else if(s3eDeviceGetInt (S3E_DEVICE_OS) == S3E_OS_ID_ANDROID) s3eFlurryStart("HD4EZJ147ELQAT9H43KM"); g_ButtonLogEvent->m_Enabled = true; g_ButtonLogTimedEvent->m_Enabled = true; g_ButtonEndTimedEvent->m_Enabled = true; g_ButtonLogError->m_Enabled = true; g_ButtonUserInfo->m_Enabled = true; g_ButtonUserLocation->m_Enabled = true; g_ButtonToggleSendOnClose->m_Enabled = true; g_ButtonToggleSendOnPause->m_Enabled = true; g_ButtonSetDefaultMessage->m_Enabled = true; g_ButtonToggleAdBanner->m_Enabled = true; g_ButtonShowOfferWall->m_Enabled = true; s3eLocationStart(); }