Groups screen management controls. Use this class to add/remove screens and set them active or inactive.
More...
#include <ScreenSystem.hpp>
Groups screen management controls. Use this class to add/remove screens and set them active or inactive.
◆ AddScreen() [1/2]
static void OficinaFramework::ScreenSystem::AddScreen |
( |
Screen * |
scr | ) |
|
|
static |
Enqueues a screen to be added to the list.
- Parameters
-
scr | Pointer to the screen to be added. |
- Exceptions
-
◆ AddScreen() [2/2]
static void OficinaFramework::ScreenSystem::AddScreen |
( |
Screen * |
scr, |
|
|
float |
Depth |
|
) |
| |
|
static |
Enqueues a screen to be added to the list.
- Parameters
-
scr | Pointer to the screen to be added. |
Depth | Depth to be given to the screen on initialization. This will reflect on update and draw order. |
- Exceptions
-
◆ ClearScreens()
static void OficinaFramework::ScreenSystem::ClearScreens |
( |
| ) |
|
|
static |
Clears all screens from the list. This will remove the screens from list and dispose them.
◆ ClearWindow()
static void OficinaFramework::ScreenSystem::ClearWindow |
( |
| ) |
|
|
static |
Clears window of artifacts.
◆ Debug_AddLine()
static void OficinaFramework::ScreenSystem::Debug_AddLine |
( |
std::string |
text | ) |
|
|
static |
Adds a text line to the debugger.
- Parameters
-
text | The text to be added to the debugger. |
◆ Debug_SetFont()
Sets the main font to be used on the debugger.
- Parameters
-
font | A pointer to the font to be used. |
- Warning
- Please allocate a font that will be only used on the debugger. The system itself will unload the font when necessary.
◆ Debug_ToggleMinimalist()
static void OficinaFramework::ScreenSystem::Debug_ToggleMinimalist |
( |
| ) |
|
|
static |
Toggles debug as minimalistic or not.
◆ dispose()
static void OficinaFramework::ScreenSystem::dispose |
( |
| ) |
|
|
static |
Disposes the Screen System and deletes the Window.
◆ DrawScreens()
static void OficinaFramework::ScreenSystem::DrawScreens |
( |
| ) |
|
|
static |
Draws all screens that are not marked as invisible.
◆ GetBiggestDepth()
static float OficinaFramework::ScreenSystem::GetBiggestDepth |
( |
| ) |
|
|
static |
Gets the biggest depth value available on the manager.
- Warning
- This method will assume that the screen list is sorted!
- Returns
- Biggest depth value of the screen that is most in front.
◆ GetSmallestDepth()
static float OficinaFramework::ScreenSystem::GetSmallestDepth |
( |
| ) |
|
|
static |
Gets the smallest depth value available on the manager.
- Warning
- This method will assume that the screen list is sorted!
- Returns
- Smallest depth value of the screen that is most in back.
◆ GetWindowHandle()
static SDL_Window* OficinaFramework::ScreenSystem::GetWindowHandle |
( |
| ) |
|
|
static |
Offers direct access to the SDL2 window handle.
- Warning
- Be careful when dealing directly with this. Oficina manipulates the window directly on initialization and runtime, so there is no need for advanced operations, unless you need the handle for third-party APIs.
- Returns
- Pointer for the SDL2 Window.
◆ GetWindowSize()
static vec2dw OficinaFramework::ScreenSystem::GetWindowSize |
( |
| ) |
|
|
static |
Gets the window size (do not confuse with viewport).
- Returns
- A vec2 with dword precision with the window size.
◆ init()
static void OficinaFramework::ScreenSystem::init |
( |
std::string |
windowname, |
|
|
vec2dw |
windowsize, |
|
|
bool |
fullscreen, |
|
|
std::string |
iconpath, |
|
|
bool |
vsync |
|
) |
| |
|
static |
Initializes the Window and the Screen System.
- Parameters
-
windowname | Caption of the main window. |
windowsize | Size of the window. |
fullscreen | Whether the main window is in fullscreen mode or not. |
iconpath | Path to the main window's icon. Can be set to an empty string in case none is intended. |
vsync | Whether VSync is active or not. |
- Exceptions
-
◆ IsDebugActive()
static bool OficinaFramework::ScreenSystem::IsDebugActive |
( |
| ) |
|
|
static |
Gets if the debug mode is active.
- Returns
- Whether debug is active or not.
◆ IsFullScreen()
static bool OficinaFramework::ScreenSystem::IsFullScreen |
( |
| ) |
|
|
static |
Gets the window mode.
- Returns
- Whether the window is fullscreen or not.
◆ IsLoadingThreadBusy()
static bool OficinaFramework::ScreenSystem::IsLoadingThreadBusy |
( |
| ) |
|
|
static |
Gets whether the loading thread is currently loading screens or not.
- Returns
- If the loading thread is in a work.
◆ RemoveScreen()
static void OficinaFramework::ScreenSystem::RemoveScreen |
( |
Screen * |
scr | ) |
|
|
static |
Sets a screen to be removed and disposed.
- Parameters
-
scr | A pointer to the screen to be removed. |
◆ SetDebug()
static void OficinaFramework::ScreenSystem::SetDebug |
( |
bool |
state | ) |
|
|
static |
Sets the debug state.
- Parameters
-
state | State of the debug to be set to. |
◆ SetFullScreen()
static void OficinaFramework::ScreenSystem::SetFullScreen |
( |
bool |
state | ) |
|
|
static |
Sets the fullscreen mode.
- Parameters
-
state | Whether to set the display to fullscreen or not. |
◆ SetWindowSize()
static void OficinaFramework::ScreenSystem::SetWindowSize |
( |
vec2dw |
size | ) |
|
|
static |
Sets the window size (do not confuse with viewport).
- Parameters
-
size | A vec2 with dword precision indicating new window size. |
◆ SortScreens()
static void OficinaFramework::ScreenSystem::SortScreens |
( |
| ) |
|
|
static |
Sorts screens by depth on the manager. Useful if you manually changed the depth of a certain screen.
- Warning
- Sorting screens on gameloop may give unexpected behaviour on the current frame.
◆ SwapWindow()
static void OficinaFramework::ScreenSystem::SwapWindow |
( |
| ) |
|
|
static |
Swaps window for a new draw routine.
◆ UnloadAllScreens()
static void OficinaFramework::ScreenSystem::UnloadAllScreens |
( |
| ) |
|
|
static |
Unloads the content of all screen on the list, then removes them.
◆ UpdateScreens()
static void OficinaFramework::ScreenSystem::UpdateScreens |
( |
| ) |
|
|
static |
Updates the logic of all screens on the list.
◆ EngineCore
The documentation for this class was generated from the following file: