#include <tb_realtime_application.h>
Public Member Functions | |
RealtimeApplication (ApplicationHandlerInterface &applicationHandler) | |
~RealtimeApplication (void) | |
void | Open (void) |
void | Run (void) |
void | Close (void) |
void | SetWindowMenu (const ApplicationMenu &menu) |
void | SetContextMenu (const ApplicationMenu &menu) |
void | SetWindowStatus (const ApplicationStatus &status) |
void | SetWindowTitle (const tbCore::tbString &windowTitle) |
void | OpenDialog (const ApplicationDialog &dialog) |
void | CloseDialog (const ApplicationDialog &dialog) |
bool | OkayMessageBox (const tbCore::tbString &title, const tbCore::tbString &message) |
bool | OkayCancelMessageBox (const tbCore::tbString &title, const tbCore::tbString &message) |
bool | OpenFileDialog (tbCore::tbString &fileToOpen, const tbCore::tbString &fileExtension) |
bool | SaveFileDialog (tbCore::tbString &fileToSave, const tbCore::tbString &fileExtension) |
Create an application using OpenGL to render a real-time view-port. A real-time message pump will be used instead of blocking until a system message/event is fired.
|
explicit |
Prepares an application to create a window with an OpenGL context. The window will not be created or opened in the constructor of the RealtimeApplication, instead it will be delayed until Open() is called.
applicationHandler | The object to be invoked when the system fires an event or the user acts upon items within the application. The scope of this object must outlive the scope of the RealtimeApplication object. |
TurtleBrains::Application::RealtimeApplication::~RealtimeApplication | ( | void | ) |
Cleanup any resources created when preparing or running a RealtimeApplication.
void TurtleBrains::Application::RealtimeApplication::Close | ( | void | ) |
Mark the application to close, the actual close event will be delayed and may be performed after the current frame when the operating system messages are processed.
void TurtleBrains::Application::RealtimeApplication::CloseDialog | ( | const ApplicationDialog & | dialog | ) |
Closes a custom built dialog prompt, must be called for any dialog opened with OpenDialog and will clean up any system resources allocated for the dialog box.
dialog | The dialog box to be closed. |
bool TurtleBrains::Application::RealtimeApplication::OkayCancelMessageBox | ( | const tbCore::tbString & | title, |
const tbCore::tbString & | message | ||
) |
Opens a small, modal, message box displaying a title, a message and two buttons to the user to press Okay or Cancel. The function will not return until the user has pressed either to Okay or Cancel buttons, and the result will be returned.
title | The title of the message box, it is wise to contain your application name for user reference. |
message | The message that the user needs to see and accept or decline with the Okay/Cancel buttons. |
bool TurtleBrains::Application::RealtimeApplication::OkayMessageBox | ( | const tbCore::tbString & | title, |
const tbCore::tbString & | message | ||
) |
Opens a small, modal, message box displaying a title, a message and an Okay button. Due to the nature of a modal prompt this function will not return until the user has pressed the Okay button.
title | The title of the message box, it is wise to contain your application name for user reference. |
message | The message that the user needs to see and accept with the Okay button. |
void TurtleBrains::Application::RealtimeApplication::Open | ( | void | ) |
Creates and opens a real-time window with OpenGL clearing and displaying a black screen, but waits until Run() is called to enter the real-time message pump of the OS.
void TurtleBrains::Application::RealtimeApplication::OpenDialog | ( | const ApplicationDialog & | dialog | ) |
Opens a custom built, modeless, dialog for your application which will continue to update while your application runs. This is not a modal dialog prompt and the function will return before the user has finished using your dialog. The dialog will remain visible until closed with a call to CloseDialog().
dialog | The dialog box to be opened. |
bool TurtleBrains::Application::RealtimeApplication::OpenFileDialog | ( | tbCore::tbString & | fileToOpen, |
const tbCore::tbString & | fileExtension | ||
) |
Opens a dialog prompt to navigate/open a file using the native prompt on the operating system. This is a modal dialog prompt and the function will not return until the user has finished.
void TurtleBrains::Application::RealtimeApplication::Run | ( | void | ) |
Begins processing messages from the operating system, this should be called from the main thread as it handles application / interface objects, and will not return the application has been closed. Once running, the ApplicationHandlerInterface object will be invoked during system events and user actions.
bool TurtleBrains::Application::RealtimeApplication::SaveFileDialog | ( | tbCore::tbString & | fileToSave, |
const tbCore::tbString & | fileExtension | ||
) |
Opens a dialog prompt to navigate to a file for saving using the native prompt on the operating system. This is a modal dialog prompt and the function will not return until the user has finished.
void TurtleBrains::Application::RealtimeApplication::SetContextMenu | ( | const ApplicationMenu & | menu | ) |
Apply an ApplicationMenu to open as the context menu when the user right-clicks / secondary clicks within the window. This will not open or show the menu until the user takes action.
void TurtleBrains::Application::RealtimeApplication::SetWindowMenu | ( | const ApplicationMenu & | menu | ) |
Apply an ApplicationMenu to the top of the Window in a manner the user will expect depending on the operating system used.
void TurtleBrains::Application::RealtimeApplication::SetWindowStatus | ( | const ApplicationStatus & | status | ) |
Apply a status bar to the application window to inform the user about selection or status of the application.
void TurtleBrains::Application::RealtimeApplication::SetWindowTitle | ( | const tbCore::tbString & | windowTitle | ) |
Set the window title to a specified title so the user knows where/what your application is.