phoenix::OS
OS is the core class for phoenix applications. It contains the main application processing functions, as well as common functionality such as file dialogs and desktop geometry detection.
struct OS : Object {
static void main();
static bool pendingEvents();
static void processEvents();
static void quit();
};
static void OS::main();
Enter the main message loop for the application. This function will not return until OS::quit() is called by a callback function. It is preferred to use this function if you can, as it will result in no CPU usage while your application is idle. However, if you need to perform processing without user input, you should use processEvents() instead.
static bool OS::pendingEvents();
Returns true if user events are pending. For instance, if a user has pressed a button. You will need to call processEvents() to process them.
static void OS::processEvents();
Processes all events that are currently in queue. This function will never block, even if there are no events in queue. However, there is no telling how long it will take to process all of the events that are pending.
If you are not using OS::main(), you must call this function frequently, otherwise the user interface will become unresponsive.
static void OS::quit();
Terminates the OS::main() loop. This can only safely be called once. Do not attempt to re-enter OS::main() after calling OS::quit().