Browse Source

Readme: Add BeginFrame and PresentFrame to the example code (#683)

* docs: add BeginFrame and PresentFrame to the example code.

* Some rephrasing, use backend procedures, move BeginFrame down

---------

Co-authored-by: Michael Ragazzon <[email protected]>
MicroBlock 1 year ago
parent
commit
1c14a7c33a
1 changed files with 8 additions and 0 deletions
  1. 8 0
      readme.md

+ 8 - 0
readme.md

@@ -326,9 +326,17 @@ int main(int argc, char** argv)
         // modified and added elements, or changed data in data bindings.
         context->Update();
 
+        // Prepare the application for rendering, such as by clearing the window. This calls
+        // into the RmlUi backend interface, replace with your own procedures as appropriate.
+        Backend::BeginFrame();
+        
         // Render the user interface. All geometry and other rendering commands are now
         // submitted through the render interface.
         context->Render();
+
+        // Present the rendered content, such as by swapping the swapchain. This calls into
+        // the RmlUi backend interface, replace with your own procedures as appropriate.
+        Backend::PresentFrame();
     }
 
     Rml::Shutdown();