Main GUI application class.
More...
#include <GUISystem.h>
Main GUI application class.
Use example of GUI:
int main(
int argc,
char** argv )
{
app.Init();
return app.MainLoop();
}
You don't have to write main function. Instead use project templates for different platforms. To use gui implement Application class.
- Todo:
- Supply project templates.
sw::gui::GUISystem::GUISystem |
( |
int |
argc, |
|
|
char ** |
argv, |
|
|
INativeGUI * |
gui |
|
) |
| |
|
explicit |
sw::gui::GUISystem::~GUISystem |
( |
| ) |
|
|
virtual |
const char * sw::gui::GUISystem::CommandLineArg |
( |
int |
num | ) |
|
Returns command line argument. 0 is first argument not program name.
HostWindow * sw::gui::GUISystem::CreateNativeHostWindow |
( |
uint16 |
width, |
|
|
uint16 |
height, |
|
|
const std::string & |
windowTitle |
|
) |
| |
Creates host window based on native window. Window will be added to windows list.
- Note
- windowDesc can change. For instance: if you set AdjustSize to true, function will return real window size.
void sw::gui::GUISystem::DefaultInit |
( |
uint16 |
width, |
|
|
uint16 |
height, |
|
|
const std::string & |
windowTitle |
|
) |
| |
|
protected |
Default GUI system initialization function.
bool sw::gui::GUISystem::DefaultInitGraphicAPI |
( |
| ) |
|
|
protected |
Default graphic api initialization.
bool sw::gui::GUISystem::DefaultInitNativeGUI |
( |
| ) |
|
|
protected |
Default native GUI initialization.
Native GUI object is set in constructor. Here we initialize it. Function creates native input object.
bool sw::gui::GUISystem::DefaultInitRenderingSystem |
( |
| ) |
|
|
protected |
Initializes rendering system.
- Note
- m_resourceManager and m_graphicApi must be already initialized;
void sw::gui::GUISystem::DefaultInitWithoutWindow |
( |
| ) |
|
|
protected |
Makes initialization but leaves window creation for user.
Size sw::gui::GUISystem::GetMemorySize |
( |
| ) |
|
Zwraca ilość pamięci zajmowanej przez obiekt. Implementacje w klasach potomnych powinny też doliczać rekurencyjnie pamięć zajmowaną przez obiekty, których właścicielem jest ten obiekt.
void sw::gui::GUISystem::HandleEvents |
( |
| ) |
|
Processes messages and passes them to focused window.
void sw::gui::GUISystem::Init |
( |
| ) |
|
Invoke this function in application entry point (main).
void sw::gui::GUISystem::Initialize |
( |
| ) |
|
|
protectedvirtual |
GUI subsystems initialization.
If you need specific gui initialization in your application override this function. You can set different GraphicApi or input api.
Reimplemented in sw::gui::TestFramework, and Application.
int sw::gui::GUISystem::MainLoop |
( |
| ) |
|
bool sw::gui::GUISystem::MainLoopCore |
( |
| ) |
|
One step of main loop.
- Todo:
- Consider making this function virtual in future.
- Returns
- Returns true if application should end. Otherwise returns false.
int sw::gui::GUISystem::NumCommandLineArgs |
( |
| ) |
|
Gets number of commnad line arguments.
Function doesn't take program nameinto account .
virtual void sw::gui::GUISystem::OnClosing |
( |
| ) |
|
|
protectedpure virtual |
void sw::gui::GUISystem::OnFocusChanged |
( |
INativeWindow * |
window, |
|
|
bool |
value |
|
) |
| |
Changes focused window.
Delegate for native GUI.
virtual void sw::gui::GUISystem::OnIdle |
( |
| ) |
|
|
protectedpure virtual |
virtual void sw::gui::GUISystem::OnInitialized |
( |
| ) |
|
|
protectedpure virtual |
const char * sw::gui::GUISystem::ProgramPath |
( |
| ) |
|
Returns program name retrived from 0 command line argument.
friend class GUISystemTester |
|
friend |
Only one window can have focus and only this will be processed.
Contains object responsible for dealing with specifics graphic apis.
GUISystem * sw::gui::GUISystem::m_instance = nullptr |
|
staticprivate |
Native window system used to display main application window.
RenderingSystemOPtr sw::gui::GUISystem::m_renderingSystem |
|
protected |
All rendering connceted functionalities.
std::vector< HostWindow* > sw::gui::GUISystem::m_windows |
|
protected |
The documentation for this class was generated from the following files: