diff --git a/Include/RmlUi/Core/RenderManager.h b/Include/RmlUi/Core/RenderManager.h index 374e0f134..a03caa311 100644 --- a/Include/RmlUi/Core/RenderManager.h +++ b/Include/RmlUi/Core/RenderManager.h @@ -76,7 +76,7 @@ class RMLUICORE_API RenderManager : NonCopyMoveable { RenderManager(RenderInterface* render_interface); ~RenderManager(); - void PrepareRender(); + void PrepareRender(Vector2i dimensions); void SetViewport(Vector2i dimensions); Vector2i GetViewport() const; diff --git a/Source/Core/Context.cpp b/Source/Core/Context.cpp index d742ba0c0..7706da6ee 100644 --- a/Source/Core/Context.cpp +++ b/Source/Core/Context.cpp @@ -216,7 +216,7 @@ bool Context::Render() { RMLUI_ZoneScoped; - render_manager->PrepareRender(); + render_manager->PrepareRender(dimensions); root->Render(); diff --git a/Source/Core/RenderManager.cpp b/Source/Core/RenderManager.cpp index 6da9a6fea..a5d889db2 100644 --- a/Source/Core/RenderManager.cpp +++ b/Source/Core/RenderManager.cpp @@ -68,7 +68,7 @@ RenderManager::~RenderManager() ReleaseAllTextures(); } -void RenderManager::PrepareRender() +void RenderManager::PrepareRender(Vector2i dimensions) { #ifdef RMLUI_DEBUG const RenderState default_state; @@ -77,6 +77,8 @@ void RenderManager::PrepareRender() RMLUI_ASSERT(state.transform == default_state.transform); RMLUI_ASSERTMSG(render_stack.empty(), "Unbalanced render stack detected, ensure every PushLayer call has a corresponding call to PopLayer."); #endif + + SetViewport(dimensions); } void RenderManager::SetViewport(Vector2i dimensions)