libAlgAudio  v1.99-440-g08538e5-dirty
The development library for AlgAudio framework.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
AlgAudio::SDLMain Class Reference

#include <SDLMain.hpp>

Public Types

enum  CustomEventCodes { NOTIFY_SUBPROCESS, NOTIFY_OSC, NOTIFY_TIMER }
 

Static Public Member Functions

static unsigned int GetWindowNum ()
 
static void Init ()
 
static void Loop ()
 
static void PushNotifyOSCEvent ()
 
static void PushNotifySubprocessEvent ()
 
static void Quit ()
 
static void RegisterWindow (std::shared_ptr< Window >)
 
static void SetTextInput (bool)
 
static void Step ()
 
static void UnregisterAll ()
 
static void UnregisterWindow (std::shared_ptr< Window >)
 

Static Public Attributes

static std::atomic< int > notify_event_id
 
static Signal< float > on_before_frame
 
static std::atomic_bool running
 

Detailed Description

The static interface implementing the main loop, event processing and window rendering.

Member Enumeration Documentation

Enumerator
NOTIFY_SUBPROCESS 
NOTIFY_OSC 
NOTIFY_TIMER 

Member Function Documentation

static unsigned int AlgAudio::SDLMain::GetWindowNum ( )
inlinestatic

Returns the number of currently registered windows.

static void AlgAudio::SDLMain::Init ( )
static

Init() must be caled before any other calls to this class members.

static void AlgAudio::SDLMain::Loop ( )
static

This function enters the main loop, which keeps procesing events and triggering their routines. Note that it's not reentrant.

Warning
This is a blocking call. This function will not return until Quit() is called.
static void AlgAudio::SDLMain::PushNotifyOSCEvent ( )
static
static void AlgAudio::SDLMain::PushNotifySubprocessEvent ( )
static
static void AlgAudio::SDLMain::Quit ( )
static

Stops the main loop.

static void AlgAudio::SDLMain::RegisterWindow ( std::shared_ptr< Window )
static

A registered window is managed and rendered as SDLMain sees fit. This is handy it you wish to create a window and forget about it, as SDLMain will then sustain the ownership of the window, and it will keep redrawing it when needed. However, if you wish to redraw a window on your own, you should not register it.

static void AlgAudio::SDLMain::SetTextInput ( bool  )
static
static void AlgAudio::SDLMain::Step ( )
static

Executes a single step of the main loop. This call is not blocking.

static void AlgAudio::SDLMain::UnregisterAll ( )
static

Unregisters all registered windows.

See also
UnregisterWindow
static void AlgAudio::SDLMain::UnregisterWindow ( std::shared_ptr< Window )
static

Unregisters a window. It will no longer be managed by SDLMain, you will have to render it on your own, and manually process its events.

See also
RegisterWindow

Member Data Documentation

std::atomic<int> AlgAudio::SDLMain::notify_event_id
static
Signal<float> AlgAudio::SDLMain::on_before_frame
static

Hook your code to this signal if you wish to perform animations. This signal will be triggered every time a fram is drawn, just before rendering happens. The float argument is the time delta (in seconds) from the time where the last frame was drawn.

std::atomic_bool AlgAudio::SDLMain::running
static

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