ExampleApp
struct · #include <rayrai/example_common.hpp>
Minimal SDL/ImGui wrapper for RayraiWindow examples.
Public member functions
init
cpp
bool init(const char *title, int width, int height, bool visible=true)Initialize SDL, OpenGL context, and ImGui backends.
Requests a 4.3 core context and falls back to 3.3; enables vsync.
Parameters
| Parameter | Description |
|---|---|
title | Window title. |
width | Window width. |
height | Window height. |
visible | False creates a hidden window (e.g. for headless captures). |
Returns True on success.
shutdown
cpp
void shutdown()Shutdown ImGui/SDL resources.
processEvents
cpp
void processEvents()Poll SDL events and update quit flag.
beginFrame
cpp
void beginFrame()Begin a new ImGui frame.
renderViewer
cpp
void renderViewer(raisin::RayraiWindow &viewer)Render the RayraiWindow output into an ImGui window.
Calls viewer.update() at the drawable size, forwarding hover state and the cursor position in drawable pixels, and shows the result full-window.
Parameters
| Parameter | Description |
|---|---|
viewer | RayraiWindow instance to render. |
endFrame
cpp
void endFrame()End the ImGui frame and swap buffers.
Public attributes
window
cpp
SDL_Window *windowMain window (null before init()).
context
cpp
SDL_GLContext contextOpenGL context of window.
quit
cpp
bool quitSet by processEvents() when the window is closed.