Handles events, input & display.
More...
#include <Window.hpp>
|
| | Window () |
| | Window creation constructor.
|
| | ~Window () |
| | Destructor.
|
| void | close () noexcept |
| | Close window.
|
| void | swap () const noexcept |
| | Swap backbuffer with window framebuffer.
|
| void | show () const noexcept |
| | Show window.
|
| void | hide () const noexcept |
| | Hide window.
|
| void | minimize () const noexcept |
| | Minimize window.
|
| void | maximize () const noexcept |
| | Maximize window.
|
| void | restore () const noexcept |
| | Restore window to previous *mize state.
|
| void | raise () const noexcept |
| | Raise the window to be on top of other windows.
|
| void | request_attention () const noexcept |
| | Flash window on taskbar for user attention.
|
| void | resize (const int width, const int height) const noexcept |
| | Resizes window.
|
| void | set_fullscreen (const bool fullscreen) const noexcept |
| | Toggle fullscreen.
|
| void | set_taskbar_progress (const float progress) noexcept |
| | Sets the taskbar icon progress overlay.
|
| void | set_title (const std::string &title) |
| | Set window title.
|
| void | append_title (const std::string &append) |
| | Append to window title from the settings.
|
| void | set_icon (const std::string &icon) noexcept |
| | Set window icon.
|
| void | handle_window_events (const SDL_Event &events) |
| | Process window specific events.
|
| int | screen_width () const noexcept |
| | Return the current drawable width in pixels.
|
| int | screen_height () const noexcept |
| | Return the current drawable height in pixels.
|
| int | virtual_screen_width () const noexcept |
| | Return the configured logical screen width.
|
| int | virtual_screen_height () const noexcept |
| | Return the configured logical screen height.
|
| bool | is_open () const noexcept |
| | Is the window open or closed.
|
| float | get_display_scale () const noexcept |
| | Get display content scale.
|
| SDL_Window * | handle () const noexcept |
| | Get SDL window pointer.
|
| SDL_GLContext | context () const noexcept |
| | Get SDL GL context.
|
Handles events, input & display.
Definition at line 28 of file Window.hpp.
◆ Window() [1/3]
| galaxy::Window::Window |
( |
| ) |
|
◆ ~Window()
| galaxy::Window::~Window |
( |
| ) |
|
◆ Window() [2/3]
| galaxy::Window::Window |
( |
const Window & | | ) |
|
|
privatedelete |
◆ Window() [3/3]
| galaxy::Window::Window |
( |
Window && | | ) |
|
|
privatedelete |
◆ close()
| void galaxy::Window::close |
( |
| ) |
|
|
noexcept |
Close window.
This will exit game loop.
Definition at line 158 of file Window.cpp.
◆ swap()
| void galaxy::Window::swap |
( |
| ) |
const |
|
noexcept |
Swap backbuffer with window framebuffer.
Definition at line 163 of file Window.cpp.
◆ show()
| void galaxy::Window::show |
( |
| ) |
const |
|
noexcept |
◆ hide()
| void galaxy::Window::hide |
( |
| ) |
const |
|
noexcept |
◆ minimize()
| void galaxy::Window::minimize |
( |
| ) |
const |
|
noexcept |
◆ maximize()
| void galaxy::Window::maximize |
( |
| ) |
const |
|
noexcept |
◆ restore()
| void galaxy::Window::restore |
( |
| ) |
const |
|
noexcept |
Restore window to previous *mize state.
Definition at line 192 of file Window.cpp.
◆ raise()
| void galaxy::Window::raise |
( |
| ) |
const |
|
noexcept |
Raise the window to be on top of other windows.
Definition at line 199 of file Window.cpp.
◆ request_attention()
| void galaxy::Window::request_attention |
( |
| ) |
const |
|
noexcept |
Flash window on taskbar for user attention.
Definition at line 204 of file Window.cpp.
◆ resize()
| void galaxy::Window::resize |
( |
const int | width, |
|
|
const int | height ) const |
|
noexcept |
Resizes window.
- Parameters
-
| width | Width of the window. |
| height | Height of the window. |
Definition at line 209 of file Window.cpp.
◆ set_fullscreen()
| void galaxy::Window::set_fullscreen |
( |
const bool | fullscreen | ) |
const |
|
noexcept |
Toggle fullscreen.
- Parameters
-
| fullscreen | True for fullscreen mode, False for windowed mode. |
Definition at line 215 of file Window.cpp.
◆ set_taskbar_progress()
| void galaxy::Window::set_taskbar_progress |
( |
const float | progress | ) |
|
|
noexcept |
Sets the taskbar icon progress overlay.
- Parameters
-
| progress | Clamps from 0.0f (0%) to 1.0f (100%). |
Definition at line 220 of file Window.cpp.
◆ set_title()
| void galaxy::Window::set_title |
( |
const std::string & | title | ) |
|
Set window title.
- Parameters
-
Definition at line 225 of file Window.cpp.
◆ append_title()
| void galaxy::Window::append_title |
( |
const std::string & | append | ) |
|
Append to window title from the settings.
Does not preserve last append when called again.
- Parameters
-
Definition at line 230 of file Window.cpp.
◆ set_icon()
| void galaxy::Window::set_icon |
( |
const std::string & | icon | ) |
|
|
noexcept |
Set window icon.
- Parameters
-
Definition at line 236 of file Window.cpp.
◆ handle_window_events()
| void galaxy::Window::handle_window_events |
( |
const SDL_Event & | events | ) |
|
Process window specific events.
- Parameters
-
| events | SDL_Event containing latest event from PollEvent. |
Definition at line 260 of file Window.cpp.
◆ screen_width()
| int galaxy::Window::screen_width |
( |
| ) |
const |
|
nodiscardnoexcept |
Return the current drawable width in pixels.
- Returns
- Integer.
Definition at line 281 of file Window.cpp.
◆ screen_height()
| int galaxy::Window::screen_height |
( |
| ) |
const |
|
nodiscardnoexcept |
Return the current drawable height in pixels.
- Returns
- Integer.
Definition at line 286 of file Window.cpp.
◆ virtual_screen_width()
| int galaxy::Window::virtual_screen_width |
( |
| ) |
const |
|
nodiscardnoexcept |
Return the configured logical screen width.
- Returns
- Integer.
Definition at line 291 of file Window.cpp.
◆ virtual_screen_height()
| int galaxy::Window::virtual_screen_height |
( |
| ) |
const |
|
nodiscardnoexcept |
Return the configured logical screen height.
- Returns
- Integer.
Definition at line 296 of file Window.cpp.
◆ is_open()
| bool galaxy::Window::is_open |
( |
| ) |
const |
|
nodiscardnoexcept |
Is the window open or closed.
- Returns
- Boolean.
Definition at line 301 of file Window.cpp.
◆ get_display_scale()
| float galaxy::Window::get_display_scale |
( |
| ) |
const |
|
nodiscardnoexcept |
Get display content scale.
- Returns
- Main display scale.
Definition at line 306 of file Window.cpp.
◆ handle()
| SDL_Window * galaxy::Window::handle |
( |
| ) |
const |
|
nodiscardnoexcept |
Get SDL window pointer.
- Returns
- Raw sdl window pointer.
Definition at line 311 of file Window.cpp.
◆ context()
| SDL_GLContext galaxy::Window::context |
( |
| ) |
const |
|
nodiscardnoexcept |
Get SDL GL context.
- Returns
- Opaque handle (pointer).
Definition at line 316 of file Window.cpp.
◆ operator=() [1/2]
Copy assignment operator.
◆ operator=() [2/2]
Move assignment operator.
◆ m_window
| SDL_Window* galaxy::Window::m_window |
|
private |
◆ m_context
| SDL_GLContext galaxy::Window::m_context |
|
private |
◆ m_open
| bool galaxy::Window::m_open |
|
private |
The documentation for this class was generated from the following files: