psychic-ui 0.0.0
Loading...
Searching...
No Matches
psychic_ui::SDL3Application Class Reference

#include <SDL3Application.hpp>

Public Member Functions

 SDL3Application (const SDL3Application &)=delete
SDL3Application & operator= (const SDL3Application &)=delete
 SDL3Application (SDL3Application &&)=delete
SDL3Application & operator= (SDL3Application &&)=delete
SDL3SystemWindow & open (std::shared_ptr< Window > window)
void close (const std::shared_ptr< Window > &window)
void run ()

Detailed Description

Runs Psychic UI windows on SDL3: sets up SDL's video, gives each opened Window an SDL window with an OpenGL context, and runs the event loop until every window is closed.

psychic_ui::SDL3Application app;
app.open(std::make_shared<MyWindow>());
app.run();

To put Psychic UI in an SDL window you create yourself, use SDL3SystemWindow directly.

Member Function Documentation

◆ open()

SDL3SystemWindow & psychic_ui::SDL3Application::open ( std::shared_ptr< Window > window)

Creates the window's SDL window and GL context, from the window's title, size and flags

◆ run()

void psychic_ui::SDL3Application::run ( )

Handles events and draws the windows, until none is visible or SDL asks to quit. A window is drawn after an event for it, and while it needs frames (Window::untilNextFrame: a style or layout change, an animation, a requested frame, a timer); when none does, the loop sleeps in SDL until an event or the soonest timer.


The documentation for this class was generated from the following files: