This class abstracts the backend-specific window and gui creation code.
More...
#include <TGUI/DefaultBackendWindow.hpp>
|
virtual GuiBase * | getGui () const =0 |
| Returns the gui object that is created and destroyed by this class.
|
|
virtual bool | isOpen () const =0 |
| Returns whether the window is still open.
|
|
virtual void | close ()=0 |
| Closes the window.
|
|
virtual bool | pollEvent (Event &event)=0 |
| Retrieves an event from the window if there is one.
|
|
virtual void | draw ()=0 |
| Draws the gui to the window.
|
|
virtual void | mainLoop ()=0 |
| Pass control of the main loop to TGUI, if the backend supports it.
|
|
virtual void | setIcon (const String &filename)=0 |
| Changes the icon of the window.
|
|
This class abstracts the backend-specific window and gui creation code.
Normally you don't need this class as you know what the backend is and can write backend-specific code. This class is required by e.g. the Gui Builder to work independently from the backend.
◆ close()
virtual void tgui::DefaultBackendWindow::close |
( |
| ) |
|
|
pure virtual |
Closes the window.
- See also
- isOpen
◆ create()
static std::shared_ptr< DefaultBackendWindow > tgui::DefaultBackendWindow::create |
( |
unsigned int |
width, |
|
|
unsigned int |
height, |
|
|
const String & |
title |
|
) |
| |
|
static |
Creates the backend window and the gui.
- Parameters
-
width | Width of the window |
height | Height of the window |
title | Title of the window |
- Warning
- If TGUI contains multiple backends, an arbitrary one will be used
-
This function will assert when TGUI was built without a backend
◆ getGui()
virtual GuiBase * tgui::DefaultBackendWindow::getGui |
( |
| ) |
const |
|
pure virtual |
Returns the gui object that is created and destroyed by this class.
- Returns
- Pointer to the gui that is owned by this class
- Warning
- You can't access the gui after this backend window is destroyed
◆ isOpen()
virtual bool tgui::DefaultBackendWindow::isOpen |
( |
| ) |
const |
|
pure virtual |
Returns whether the window is still open.
- Returns
- Is the window still open?
- Warning
- You must call close() on this object to close the window, it does NOT happen automatically when the user presses the close button of the window (in which case you receive an event of type Event::Type::Closed from pollEvent).
◆ pollEvent()
virtual bool tgui::DefaultBackendWindow::pollEvent |
( |
Event & |
event | ) |
|
|
pure virtual |
Retrieves an event from the window if there is one.
- Parameters
-
event | Reference to event structure that will filled in by this function if there is an event |
- Returns
- True if the window had an unprocessed event. If false is returned, the event parameter is untouched.
◆ setIcon()
virtual void tgui::DefaultBackendWindow::setIcon |
( |
const String & |
filename | ) |
|
|
pure virtual |
Changes the icon of the window.
- Parameters
-
filename | Filename of the icon to load |
The documentation for this class was generated from the following file: