antispam-bee domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/ruwritingagame/public_html/wp-includes/functions.php on line 6131\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c TheGame <\/em>\u043a\u043b\u0430\u0441\u0441 \u043d\u0430 Android-\u0435.<\/p>\n\n\n\n 1. \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c Visual Studio, \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c C:\\CPP\\a999hello\\p_android\\p_android.sln<\/em> solution.<\/p>\n\n\n\n 2. \u041f\u043e\u0434 p_android.NativeActivity<\/em> \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u201cxTheGame\u201d \u0444\u0438\u043b\u044c\u0442\u0440:<\/p>\n\n\n\n Right-click \u043d\u0430 p_android.NativeActivity<\/em> project -> Add -> New Filter<\/strong><\/em>. Name – xTheGame<\/strong><\/p>\n\n\n\n Right-click \u043d\u0430 xTheGame -> Add -> Existing <\/strong>Item<\/em>,<\/p>\n\n\n\n \u0418\u0434\u0435\u043c \u043d\u0430 C:\\CPP\\a999hello<\/em><\/p>\n\n\n\n \u0424\u0430\u0439\u043b\u044b \u2013 TheGame.cpp<\/em> \u0438 TheGame.h<\/em><\/p>\n\n\n\n Add.<\/p>\n\n\n\n Right-click \u043d\u0430 p_android.NativeActivity<\/em> <\/span> project -> Properties, All Configurations<\/strong>, ARM64, C\/C++ -> General-> Additional Include Directories -> Edit<\/em>, \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u043e\u0432\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443.<\/p>\n\n\n\n \u0412\u043d\u0438\u043c\u0430\u043d\u0438\u0435<\/strong>: \u0432\u043c\u0435\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 \u043d\u0430 C:\\CPP\\a999hello<\/em> (\u0433\u0434\u0435 TheGame <\/em>\u0438 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d), \u0432\u0440\u0443\u0447\u043d\u0443\u044e <\/strong>\u0432\u0432\u0435\u0434\u0435\u043c<\/p>\n\n\n\n 2 \u0442\u043e\u0447\u043a\u0438, \u043a\u043e\u0441\u0430\u044f, 2 \u0442\u043e\u0447\u043a\u0438, \u0447\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0414\u0412\u0410 \u0443\u0440\u043e\u0432\u043d\u044f \u0432\u0432\u0435\u0440\u0445 (\u043e\u0442 p_android.NativeActivity<\/em> <\/span> \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0433\u043e \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430).<\/p>\n\n\n\n Ok, Apply, Ok.<\/p>\n\n\n\n \u0424\u0430\u0439\u043b \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 C:\/CPP\/engine<\/em>.<\/p>\n\n\n\n \u041f\u043e\u0434 p_android.NativeActivity<\/em> \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u043e\u0432\u044b\u0439 \u0444\u0438\u043b\u044c\u0442\u0440, \u0438\u043c\u044f – xEngine<\/em>. <\/p>\n\n\n\n \u041f\u043e\u0434 xEngine <\/em>add Existing <\/strong>Item C:\\CPP\\engine\\linmath.h<\/em><\/p>\n\n\n\n \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u0441\u044b\u043b\u043a\u0443: right-click \u043d\u0430 p_android.NativeActivity<\/em> project -> Properties, All Configurations<\/strong>, ARM64, C\/C++ -> General, Additional Include Directories -> Edit<\/em>, \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0443, \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043d\u0430 C:\\CPP\\engine<\/em>, Select Folder, Ok, Apply, Ok.<\/p>\n\n\n\n 6. \u041f\u0435\u0440\u0435\u043d\u0435\u0441\u0435\u043c Android-\u043e\u0432\u0441\u043a\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e myPollEvents <\/em>\u0438 mySwapBuffers<\/em> \u0432 platform.h\/cpp<\/em>. \u0417\u0430\u043e\u0434\u043d\u043e \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0435\u043c mylog()<\/em> \u0432 .cpp<\/em> \u0442\u043e\u0436\u0435.<\/p>\n\n\n\n \u041e\u0442\u043a\u0440\u043e\u0435\u043c platform.h<\/em> \u0438 \u0437\u0430\u043c\u0435\u043d\u0438\u043c \u043a\u043e\u0434 \u043d\u0430:<\/p>\n\n\n <\/p>\n\n\n\n 7. \u041f\u043e\u0434 xPlatform <\/em>\u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u043e\u0432\u044b\u0439 C++<\/strong> file, <\/p>\n\n\n\n Name – platform.cpp<\/em><\/p>\n\n\n\n Location: C:\\CPP\\p_android\\<\/em><\/p>\n\n\n\n \u041a\u043e\u0434:<\/p>\n\n\n <\/p>\n\n\n\n 8. \u041f\u043e\u043c\u0435\u043d\u044f\u0435\u043c main.cpp<\/em> \u043d\u0430 \u0432\u044b\u0437\u043e\u0432 TheGame <\/em>\u043a\u043b\u0430\u0441\u0441\u0430 \u0432\u043c\u0435\u0441\u0442\u043e \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u044f \u0437\u0435\u043b\u0435\u043d\u043e\u0433\u043e \u044d\u043a\u0440\u0430\u043d\u0430.<\/p>\n\n\n\n \u041e\u0442\u043a\u0440\u043e\u0435\u043c main.cpp<\/em> \u0438 \u0437\u0430\u043c\u0435\u043d\u0438\u043c \u043a\u043e\u0434 \u043d\u0430:<\/p>\n\n\n <\/p>\n\n\n\n 9. \u0412 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 builder \u043d\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442 math \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a. \u041d\u0430\u0434\u043e \u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0441 \u043a\u043b\u044e\u0447\u043e\u043c -lm<\/strong>.<\/p>\n\n\n\n \u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c p_android.NativeActivity<\/em> properties, All Configurations, ARM64, \u0438\u0434\u0435\u043c \u0432 Configuration Properties -> Linker -> All Options<\/em>, \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c Additional Options -> Edit<\/em>, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c<\/p>\n\n\n\n <\/p>\n\n\n\n Ok, Apply, Ok.<\/p>\n\n\n\n 10. \u0418 \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u0434\u0435\u043a\u043e\u0440\u0430\u0442\u0438\u0432\u043d\u044b\u0439<\/em> \u0448\u0442\u0440\u0438\u0445 \u0440\u0430\u0434\u0438 \u0435\u0434\u0438\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u0438\u044f \u0441 Windows \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c:<\/p>\n\n\n\n \u041f\u043e\u0434 p_android.NativeActivity<\/em> \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u043e\u0432\u044b\u0439 \u0444\u0438\u043b\u044c\u0442\u0440 “Source Files<\/strong>“<\/p>\n\n\n\n \u0412 Solution Explorer<\/em>-\u0435 (\u043f\u0440\u0430\u0432\u0430\u044f \u043f\u0430\u043d\u0435\u043b\u044c) drag-and-drop \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u0432 Source Files<\/strong>:<\/p>\n\n\n\n \u0422\u0435\u043f\u0435\u0440\u044c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0442\u0430\u043a\u0430\u044f:<\/p>\n\n\n\n 11. \u0412\u043a\u043b\u044e\u0447\u0430\u0435\u043c Android, \u0440\u0430\u0437\u0431\u043b\u043e\u043a\u0438\u0440\u0443\u0435\u043c<\/strong>, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u043a PC USB \u043a\u0430\u0431\u0435\u043b\u0435\u043c, \u0440\u0430\u0437\u0440\u0435\u0448\u0430\u0435\u043c debugging, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c:<\/p>\n\n\n\n Ta-\u0434a!<\/p>\n\n\n\n <\/p>\n\n\n\n \u0420\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 \u041e\u0411\u041e\u0418\u0425, \u043d\u0430 Android-\u0435 \u0418 \u043d\u0430 Windows-\u0435!<\/p>\n\n\n\n \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u041c\u041e\u0416\u0415\u041c \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0415\u0421\u0422\u042c \u0440\u0435\u0430\u043b\u044c\u043d\u044b\u0439 cross-platform!<\/p>\n\n\n\n <\/p>\n","protected":false},"excerpt":{"rendered":" \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c TheGame \u043a\u043b\u0430\u0441\u0441 \u043d\u0430 Android-\u0435. 1. \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c Visual Studio, \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c C:\\CPP\\a999hello\\p_android\\p_android.sln solution. 2. \u041f\u043e\u0434 p_android.NativeActivity \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u201cxTheGame\u201d \u0444\u0438\u043b\u044c\u0442\u0440: Right-click \u043d\u0430 p_android.NativeActivity project -> Add -> New Filter. Name – xTheGame \u041f\u043e\u0434 xTheGame \u0434\u043e\u0431\u0430\u0432\u0438\u043c Existing Item: Right-click \u043d\u0430 xTheGame -> Add -> Existing Item, \u0418\u0434\u0435\u043c \u043d\u0430 C:\\CPP\\a999hello \u0424\u0430\u0439\u043b\u044b \u2013 TheGame.cpp \u0438 TheGame.h Add. […]<\/p>\n","protected":false},"author":1,"featured_media":474,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-366","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cross-platform-3d"],"_links":{"self":[{"href":"https:\/\/writingagame.ru\/index.php\/wp-json\/wp\/v2\/posts\/366","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/writingagame.ru\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/writingagame.ru\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/writingagame.ru\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/writingagame.ru\/index.php\/wp-json\/wp\/v2\/comments?post=366"}],"version-history":[{"count":8,"href":"https:\/\/writingagame.ru\/index.php\/wp-json\/wp\/v2\/posts\/366\/revisions"}],"predecessor-version":[{"id":473,"href":"https:\/\/writingagame.ru\/index.php\/wp-json\/wp\/v2\/posts\/366\/revisions\/473"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/writingagame.ru\/index.php\/wp-json\/wp\/v2\/media\/474"}],"wp:attachment":[{"href":"https:\/\/writingagame.ru\/index.php\/wp-json\/wp\/v2\/media?parent=366"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/writingagame.ru\/index.php\/wp-json\/wp\/v2\/categories?post=366"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/writingagame.ru\/index.php\/wp-json\/wp\/v2\/tags?post=366"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}
\n\n\n\n
\n\n\n\n
\n\n\n\n..\/..<\/code><\/pre>\n\n\n\n
\n\n\n\n
\n\n\n\n\n#pragma once\n\nvoid mylog(const char* _Format, ...);\nvoid mySwapBuffers();\nvoid myPollEvents();\n\n<\/pre><\/div>\n\n\n
\n\n\n\n\n#include <android\/log.h>\n#include "stdio.h"\n#include "TheGame.h"\n\nextern struct android_app* androidApp;\nextern const ASensor* accelerometerSensor;\nextern ASensorEventQueue* sensorEventQueue;\n\nextern EGLDisplay androidDisplay;\nextern EGLSurface androidSurface;\nextern TheGame theGame;\n\nvoid mylog(const char* _Format, ...) {\n#ifdef _DEBUG\n char outStr[1024];\n va_list _ArgList;\n va_start(_ArgList, _Format);\n vsprintf(outStr, _Format, _ArgList);\n __android_log_print(ANDROID_LOG_INFO, "mylog", outStr, NULL);\n va_end(_ArgList);\n#endif\n};\n\nvoid mySwapBuffers() {\n\teglSwapBuffers(androidDisplay, androidSurface);\n}\nvoid myPollEvents() {\n\t\/\/ Read all pending events.\n\tint ident;\n\tint events;\n\tstruct android_poll_source* source;\n\n\t\/\/ If not animating, we will block forever waiting for events.\n\t\/\/ If animating, we loop until all events are read, then continue\n\t\/\/ to draw the next frame of animation.\n\twhile ((ident = ALooper_pollAll(0, NULL, &events,\n\t\t(void**)&source)) >= 0) {\n\n\t\t\/\/ Process this event.\n\t\tif (source != NULL) {\n\t\t\tsource->process(androidApp, source);\n\t\t}\n\n\t\t\/\/ If a sensor has data, process it now.\n\t\tif (ident == LOOPER_ID_USER) {\n\t\t\tif (accelerometerSensor != NULL) {\n\t\t\t\tASensorEvent event;\n\t\t\t\twhile (ASensorEventQueue_getEvents(sensorEventQueue,\n\t\t\t\t\t&event, 1) > 0) {\n\t\t\t\t\t\/\/LOGI("accelerometer: x=%f y=%f z=%f",\n\t\t\t\t\t\/\/\tevent.acceleration.x, event.acceleration.y,\n\t\t\t\t\t\/\/\tevent.acceleration.z);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t\/\/ Check if we are exiting.\n\t\tif (androidApp->destroyRequested != 0) {\n\t\t\ttheGame.bExitGame = true;\n\t\t\tbreak;\n\t\t}\n\t}\n}\n\n<\/pre><\/div>\n\n\n
\n\n\n\n\n#include "platform.h"\n#include "TheGame.h"\n\nTheGame theGame;\n\nstruct android_app* androidApp;\n\nASensorManager* sensorManager;\nconst ASensor* accelerometerSensor;\nASensorEventQueue* sensorEventQueue;\n\nEGLDisplay androidDisplay;\nEGLSurface androidSurface;\nEGLContext androidContext;\n\n\/**\n* Initialize an EGL context for the current display.\n*\/\nstatic int engine_init_display(struct engine* engine) {\n\t\/\/ initialize OpenGL ES and EGL\n\n\t\/*\n\t* Here specify the attributes of the desired configuration.\n\t* Below, we select an EGLConfig with at least 8 bits per color\n\t* component compatible with on-screen windows\n\t*\/\n\tconst EGLint attribs[] = {\n\t\tEGL_SURFACE_TYPE, EGL_WINDOW_BIT,\n\t\tEGL_BLUE_SIZE, 8,\n\t\tEGL_GREEN_SIZE, 8,\n\t\tEGL_RED_SIZE, 8,\n\t\tEGL_NONE\n\t};\n\tEGLint format;\n\tEGLint numConfigs;\n\tEGLConfig config;\n\tEGLSurface surface;\n\tEGLContext context;\n\n\tEGLDisplay display = eglGetDisplay(EGL_DEFAULT_DISPLAY);\n\n\teglInitialize(display, 0, 0);\n\n\t\/* Here, the application chooses the configuration it desires. In this\n\t* sample, we have a very simplified selection process, where we pick\n\t* the first EGLConfig that matches our criteria *\/\n\teglChooseConfig(display, attribs, &config, 1, &numConfigs);\n\n\t\/* EGL_NATIVE_VISUAL_ID is an attribute of the EGLConfig that is\n\t* guaranteed to be accepted by ANativeWindow_setBuffersGeometry().\n\t* As soon as we picked a EGLConfig, we can safely reconfigure the\n\t* ANativeWindow buffers to match, using EGL_NATIVE_VISUAL_ID. *\/\n\teglGetConfigAttrib(display, config, EGL_NATIVE_VISUAL_ID, &format);\n\n\tANativeWindow_setBuffersGeometry(androidApp->window, 0, 0, format);\n\n\tsurface = eglCreateWindowSurface(display, config, androidApp->window, NULL);\n\n\tEGLint contextAttribs[] =\n\t{\n\t\tEGL_CONTEXT_CLIENT_VERSION, 3,\n\t\tEGL_NONE\n\t};\n\tcontext = eglCreateContext(display, config, NULL, contextAttribs);\n\n\n\tif (eglMakeCurrent(display, surface, surface, context) == EGL_FALSE) {\n\t\tmylog("ERROR: Unable to eglMakeCurrent");\n\t\treturn -1;\n\t}\n\n\tandroidDisplay = display;\n\tandroidContext = context;\n\tandroidSurface = surface;\n\n\t\/\/ Initialize GL state.\n\tglEnable(GL_CULL_FACE);\n\tglDisable(GL_DEPTH_TEST);\n\n\treturn 0;\n}\n\n\/**\n* Tear down the EGL context currently associated with the display.\n*\/\nstatic void engine_term_display() {\n\n\tif (androidDisplay != EGL_NO_DISPLAY) {\n\t\teglMakeCurrent(androidDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);\n\t\tif (androidContext != EGL_NO_CONTEXT) {\n\t\t\teglDestroyContext(androidDisplay, androidContext);\n\t\t}\n\t\tif (androidSurface != EGL_NO_SURFACE) {\n\t\t\teglDestroySurface(androidDisplay, androidSurface);\n\t\t}\n\t\teglTerminate(androidDisplay);\n\t}\n\tandroidDisplay = EGL_NO_DISPLAY;\n\tandroidContext = EGL_NO_CONTEXT;\n\tandroidSurface = EGL_NO_SURFACE;\n}\n\n\/**\n* Process the next input event.\n*\/\nstatic int32_t engine_handle_input(struct android_app* app, AInputEvent* event) {\n\tif (AInputEvent_getType(event) == AINPUT_EVENT_TYPE_MOTION) {\n\t\t\/\/engine->state.x = AMotionEvent_getX(event, 0);\n\t\t\/\/engine->state.y = AMotionEvent_getY(event, 0);\n\t\treturn 1;\n\t}\n\treturn 0;\n}\n\n\/**\n* Process the next main command.\n*\/\nstatic void engine_handle_cmd(struct android_app* app, int32_t cmd) {\n\tstruct engine* engine = (struct engine*)app->userData;\n\tswitch (cmd) {\n\tcase APP_CMD_INIT_WINDOW:\n\t\t\/\/ The window is being shown, get it ready.\n\t\tif (androidApp->window != NULL) {\n\t\t\tengine_init_display(engine);\n\t\t\t\/\/engine_draw_frame(engine);\n\t\t}\n\t\tbreak;\n\tcase APP_CMD_TERM_WINDOW:\n\t\t\/\/ The window is being hidden or closed, clean it up.\n\t\tengine_term_display();\n\t\tbreak;\n\tcase APP_CMD_GAINED_FOCUS:\n\t\t\/\/ When our app gains focus, we start monitoring the accelerometer.\n\t\tif (accelerometerSensor != NULL) {\n\t\t\tASensorEventQueue_enableSensor(sensorEventQueue,\n\t\t\t\taccelerometerSensor);\n\t\t\t\/\/ We'd like to get 60 events per second (in microseconds).\n\t\t\tASensorEventQueue_setEventRate(sensorEventQueue,\n\t\t\t\taccelerometerSensor, (1000L \/ 60) * 1000);\n\t\t}\n\t\tbreak;\n\tcase APP_CMD_LOST_FOCUS:\n\t\t\/\/ When our app loses focus, we stop monitoring the accelerometer.\n\t\t\/\/ This is to avoid consuming battery while not being used.\n\t\tif (accelerometerSensor != NULL) {\n\t\t\tASensorEventQueue_disableSensor(sensorEventQueue,\n\t\t\t\taccelerometerSensor);\n\t\t}\n\t\t\/\/ Also stop animating.\n\t\t\/\/engine_draw_frame(engine);\n\t\tbreak;\n\t}\n}\n\n\/**\n* This is the main entry point of a native application that is using\n* android_native_app_glue. It runs in its own thread, with its own\n* event loop for receiving input events and doing other things.\n*\/\nvoid android_main(struct android_app* state) {\n\n\t\/\/state->userData = &engine;\n\tstate->onAppCmd = engine_handle_cmd;\n\tstate->onInputEvent = engine_handle_input;\n\tandroidApp = state;\n\n\t\/\/ Prepare to monitor accelerometer\n\tsensorManager = ASensorManager_getInstance();\n\taccelerometerSensor = ASensorManager_getDefaultSensor(sensorManager,\n\t\tASENSOR_TYPE_ACCELEROMETER);\n\tsensorEventQueue = ASensorManager_createEventQueue(sensorManager,\n\t\tstate->looper, LOOPER_ID_USER, NULL, NULL);\n\n\t\/\/ Read all pending events.\n\tint ident;\n\tint events;\n\tstruct android_poll_source* source;\n\t\/\/wait for display\n\twhile (androidDisplay == NULL) {\n\t\t\/\/ No display yet.\n\t\t\/\/std::this_thread::sleep_for(std::chrono::seconds(1));\n\t\tmylog("No display yet\\n");\n\t\t\/\/wait for event\n\t\twhile ((ident = ALooper_pollAll(0, NULL, &events,\n\t\t\t(void**)&source)) >= 0) {\n\t\t\t\/\/ Process this event.\n\t\t\tif (source != NULL) {\n\t\t\t\tsource->process(state, source);\n\t\t\t}\n\t\t}\n\t}\n\n\tEGLint w, h;\n\teglQuerySurface(androidDisplay, androidSurface, EGL_WIDTH, &w);\n\teglQuerySurface(androidDisplay, androidSurface, EGL_HEIGHT, &h);\n\ttheGame.onScreenResize(w, h);\n\n\ttheGame.run();\n\n\tengine_term_display();\n}\n\n<\/pre><\/div>\n\n\n
\n\n\n\n-lm<\/code><\/pre>\n\n\n\n
\n\n\n\n
<\/p>\n\n\n\n
<\/p>\n\n\n\n
\n\n\n\n
<\/p>\n\n\n\n
<\/p>\n\n\n\n
\n\n\n\n