slint/examples/opengl_underlay
2023-03-27 09:27:44 +02:00
..
build.rs Update copyright information to reflect name change 2022-02-09 10:27:47 +01:00
Cargo.toml Bump version number to 1.0.0 2023-02-03 11:07:15 +01:00
CMakeLists.txt cmake: Bump minimal cmake version to 3.23 2023-03-27 09:27:44 +02:00
index.html Update copyright information to reflect name change 2022-02-09 10:27:47 +01:00
main.cpp Remove support of old SIXTYFPS_ env variable, and sixtyfps_widgets.60 2023-01-26 13:36:38 +01:00
main.rs Rust: Make new(), run() and show() report errors from the backend 2023-02-10 05:00:03 +01:00
README.md Apply the renaming also to the new opengl_underlay example pulled from master 2022-02-04 17:00:32 +01:00
scene.slint Remove AboutSixtyFPS 2023-01-31 09:38:56 +01:00

OpenGL Underlay Example

This example application demonstrates how layer two scenes together in a window:

  1. First a graphical effect is rendered using low-level OpenGL code (underlay).
  2. A scene of Slint elements is rendered above.

This is implemented using the set_rendering_notifier function on the slint::Window type. It takes a callback as a parameter and that is invoked during different phases of the rendering. In this example the invocation during the setup phase is used to prepare the pipeline for OpenGL rendering later. Then the BeforeRendering phase is used to render the graphical effect with OpenGL. Afterwards, Slint will render the scene of elements into the same back-buffer as the previous OpenGL code rendered into.

Since the graphical effect is continuous, the code in the callback requests a redraw of the contents by calling slint::Window::request_redraw().