Move the EndFrame/Present split one level out, to NativeApp.cpp

This commit is contained in:
Henrik Rydgård committed 2023-08-10 09:59:29 +02:00
1 parent e06e919624
commit 1b6d4df3a4
6 files changed
+26 -6

No files matched your search

+5 -3
View File
@@ -1136,16 +1136,18 @@ void NativeFrame(GraphicsContext *graphicsContext) {
g_screenManager->getDrawContext()->SetDebugFlags(debugFlags);
g_draw->BeginFrame();
// All actual rendering happen in here.
g_screenManager->render();
if (g_screenManager->getUIContext()->Text()) {
g_screenManager->getUIContext()->Text()->OncePerFrame();
}
// This triggers present.
g_draw->EndFrame();
// This, between EndFrame and Present, is where we should actually wait to do present time management.
// There might not be a meaningful distinction here for all backends..
g_draw->Present();
if (resized) {
INFO_LOG(G3D, "Resized flag set - recalculating bounds");
resized = false;