HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Data Fields | Static Public Attributes
tt::gui_system Class Referenceabstract

#include <ttauri/GUI/gui_system.hpp>

Inheritance diagram for tt::gui_system:
tt::gui_system_win32

Public Member Functions

 gui_system (const gui_system &)=delete
 
gui_systemoperator= (const gui_system &)=delete
 
 gui_system (gui_system &&)=delete
 
gui_systemoperator= (gui_system &&)=delete
 
virtual void init () noexcept
 Initialize after construction.
 
virtual void deinit () noexcept
 
void set_delegate (std::weak_ptr< gui_system_delegate > delegate) noexcept
 
virtual void run_from_event_queue (std::function< void()> function)=0
 
virtual int loop ()=0
 Start the GUI event loop.
 
virtual void exit (int exit_code)=0
 
gui_windowadd_window (std::unique_ptr< gui_window > window)
 
template<typename... Args>
gui_windowmake_window (Args &&...args)
 Create a new window.
 
ssize_t num_windows ()
 
void render (hires_utc_clock::time_point display_time_point)
 
bool is_gui_thread () const noexcept
 Check if this thread is the same as the gui thread.
 

Static Public Member Functions

static gui_systemglobal () noexcept
 Get a reference to the global gui_system.
 

Data Fields

thread_id const thread_id
 

Static Public Attributes

static os_handle instance
 

Detailed Description

Graphics system.

Member Function Documentation

◆ global()

static gui_system & tt::gui_system::global ( )
inlinestaticnoexcept

Get a reference to the global gui_system.

The first time this function is called it will initialize the gui_system.

Returns
A reference to the global gui_system.

◆ init()

virtual void tt::gui_system::init ( )
inlinevirtualnoexcept

Initialize after construction.

Call this function directly after the constructor on the same thread.

◆ is_gui_thread()

bool tt::gui_system::is_gui_thread ( ) const
inlinenoexcept

Check if this thread is the same as the gui thread.

◆ loop()

virtual int tt::gui_system::loop ( )
pure virtual

Start the GUI event loop.

This function will start the GUI event loop. The event loop will monitor keyboard & mouse event, changes in window size & position and rendering of all windows.

When all windows are closed this function will return with an exit code of zero, or the return value from the delegate. Calling exit() will also cause this function to return.

Returns
exit code.

Implemented in tt::gui_system_win32.

◆ make_window()

template<typename... Args>
gui_window & tt::gui_system::make_window ( Args &&... args)
inline

Create a new window.

Parameters
argsThe arguments that are forwarded to the constructor of tt::gui_window_win32.
Returns
A reference to the new window.

◆ num_windows()

ssize_t tt::gui_system::num_windows ( )

Count the number of windows managed by the GUI.


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