MCPcopy Create free account
hub / github.com/PolygonTek/BlueshiftEngine / android_main

Function android_main

Source/Player/AndroidMain.cpp:641–667  ·  view source on GitHub ↗

* This is the main entry point of a native application that is using * android_native_app_glue. It runs in its own thread, with its own * event loop for receiving input events and doing other things. */

Source from the content-addressed store, hash-verified

639 * event loop for receiving input events and doing other things.
640 */
641void android_main(android_app *appState) {
642 InitInstance(appState);
643
644 int lastMsec = BE1::PlatformTime::Milliseconds();
645
646 while (1) {
647 if (!ProcessEventLoop(appState)) {
648 ShutdownInstance();
649 }
650
651 if (surfaceCreated && !suspended) {
652 BE1::rhi.GetDisplayMetrics(app.mainRenderContext->GetContextHandle(), &displayMetrics);
653
654 if (displayMetrics.backingWidth != currentWindowWidth || displayMetrics.backingHeight != currentWindowHeight) {
655 WindowSizeChanged(displayMetrics.backingWidth, displayMetrics.backingHeight);
656 }
657
658 int currentMsec = BE1::PlatformTime::Milliseconds();
659 int elapsedMsec = currentMsec - lastMsec;
660 BE1::Clamp(elapsedMsec, 0, 1000);
661
662 lastMsec = currentMsec;
663
664 RunFrameInstance(elapsedMsec);
665 }
666 }
667}

Callers 1

android_app_entryFunction · 0.70

Calls 9

MillisecondsFunction · 0.85
GetContextHandleMethod · 0.80
InitInstanceFunction · 0.70
ProcessEventLoopFunction · 0.70
ShutdownInstanceFunction · 0.70
WindowSizeChangedFunction · 0.70
RunFrameInstanceFunction · 0.70
ClampFunction · 0.50
GetDisplayMetricsMethod · 0.45

Tested by

no test coverage detected