Topaz 5.0
Topaz Game Engine
|
Creating, modifying and destroying OS windows.
Classes | |
struct | tz::os::window_info |
Basic customisation of a newly-opened window. More... | |
tz::error_code tz::os::open_window | ( | window_info | winfo = {} | ) |
Open a new window.
Only one window can be open at a time - If you have called this function before but have not since closed the previous window, it will automatically be closed.
tz::error_code tz::os::close_window | ( | ) |
Close a previously-opened window.
Only one window can be open at a time - If you have called this function before but have not since closed the previous window, it will automatically be closed.
bool tz::os::window_is_open | ( | ) |
Query as to whether a window has been opened that has not yet been closed.
void tz::os::window_update | ( | ) |
Poll updates for a window, advancing input events etc.
If an open window does not exist, this function safely does nothing.
window_handle tz::os::get_window_handle | ( | ) |
Retrieve a opaque handle corresponding to the underlying window native.
HWND
via (HWND)(uintptr_t)handle.peek()
unsigned int tz::os::window_get_width | ( | ) |
Retrieve the width of the window, in pixels.
See window_set_dimensions to programatically resize the window.
unsigned int tz::os::window_get_height | ( | ) |
Retrieve the height of the window, in pixels.
See window_set_dimensions to programatically resize the window.
void tz::os::window_set_dimensions | ( | unsigned int | width, |
unsigned int | height ) |
Set a new width and height for the open window.
std::string tz::os::window_get_title | ( | ) |
Retrieve the title of the window.
void tz::os::window_set_title | ( | std::string_view | title | ) |
Set a new title for the open window.
void tz::os::window_maximise | ( | ) |
Maximise the window, causing it to cover the whole screen.
void tz::os::window_minimise | ( | ) |
Minimise the window, causing it to no longer be visible until maximised/shown.
void tz::os::window_show | ( | ) |
Show the window as normal, even if it is currently maximised/minimised/fullscreen.
void tz::os::window_fullscreen | ( | ) |
Display the window in proper fullscreen.
enum tz::os::window_flags |
Optional behaviours/attributes when opening windows.
Enumerator | |
---|---|
centered_window | Ignore the x and y coordinates provided within window_info and position the window approximately in the middle of the screen instead. |
maximised | Ignore the width and height provided within window_info and set set the window as maximised instead. |
transparent | When a pixel of the window's framebuffer is never drawn to, instead of being a clamped colour it is instead fully transparent. Your mileage may vary, depending on your platform. |
invisible | When the window is "opened", it is completely invisible to the user. They won't see the window, nor will it be visible in the OS' taskbar. |