* 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. */
| 639 | * event loop for receiving input events and doing other things. |
| 640 | */ |
| 641 | void 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 | } |
no test coverage detected