RAII Window. Handles events, input & display.
More...
#include <Window.hpp>
|
| Window () |
| Window creation constructor.
|
|
| ~Window () |
| Destructor.
|
|
void | process_events (entt::dispatcher &dispatcher) |
| Handles all events for the window in this frame and sends to the dispatcher.
|
|
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 | append_title (const std::string &append) |
| Append to window title.
|
|
void | set_icon (const std::string &icon) noexcept |
| Set window icon.
|
|
bool | is_open () const noexcept |
| Is the window open or closed.
|
|
Mouse & | get_mouse () noexcept |
| Get mouse cursor.
|
|
Keyboard & | get_keyboard () noexcept |
| Get keyboard.
|
|
glm::ivec2 | get_pixel_size () noexcept |
| Get window size in pixels.
|
|
SDL_Window * | handle () const noexcept |
| Get SDL window pointer.
|
|
SDL_GLContext | context () const noexcept |
| Get SDL GL context.
|
|
RAII Window. Handles events, input & display.
Definition at line 32 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 |
◆ process_events()
void galaxy::Window::process_events |
( |
entt::dispatcher & | dispatcher | ) |
|
Handles all events for the window in this frame and sends to the dispatcher.
- Parameters
-
dispatcher | Dispatcher to send event triggers to. |
Definition at line 212 of file Window.cpp.
◆ close()
void galaxy::Window::close |
( |
| ) |
|
|
noexcept |
Close window.
This will exit game loop.
Definition at line 452 of file Window.cpp.
◆ swap()
void galaxy::Window::swap |
( |
| ) |
const |
|
noexcept |
Swap backbuffer with window framebuffer.
Definition at line 457 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 485 of file Window.cpp.
◆ raise()
void galaxy::Window::raise |
( |
| ) |
const |
|
noexcept |
Raise the window to be on top of other windows.
Definition at line 492 of file Window.cpp.
◆ request_attention()
void galaxy::Window::request_attention |
( |
| ) |
const |
|
noexcept |
Flash window on taskbar for user attention.
Definition at line 497 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 502 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 508 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 514 of file Window.cpp.
◆ append_title()
void galaxy::Window::append_title |
( |
const std::string & | append | ) |
|
Append to window title.
Does not preserve last append when called again.
- Parameters
-
Definition at line 519 of file Window.cpp.
◆ set_icon()
void galaxy::Window::set_icon |
( |
const std::string & | icon | ) |
|
|
noexcept |
Set window icon.
- Parameters
-
Definition at line 525 of file Window.cpp.
◆ is_open()
bool galaxy::Window::is_open |
( |
| ) |
const |
|
nodiscardnoexcept |
Is the window open or closed.
- Returns
- Boolean.
Definition at line 553 of file Window.cpp.
◆ get_mouse()
Mouse & galaxy::Window::get_mouse |
( |
| ) |
|
|
nodiscardnoexcept |
◆ get_keyboard()
Keyboard & galaxy::Window::get_keyboard |
( |
| ) |
|
|
nodiscardnoexcept |
◆ get_pixel_size()
glm::ivec2 galaxy::Window::get_pixel_size |
( |
| ) |
|
|
nodiscardnoexcept |
Get window size in pixels.
- Returns
- Integer vec2.
Definition at line 568 of file Window.cpp.
◆ handle()
SDL_Window * galaxy::Window::handle |
( |
| ) |
const |
|
nodiscardnoexcept |
Get SDL window pointer.
- Returns
- Raw sdl window pointer.
Definition at line 576 of file Window.cpp.
◆ context()
SDL_GLContext galaxy::Window::context |
( |
| ) |
const |
|
nodiscardnoexcept |
Get SDL GL context.
- Returns
- Opaque handle (pointer).
Definition at line 581 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 |
◆ m_events
SDL_Event galaxy::Window::m_events |
|
private |
◆ m_keyboard
◆ m_mouse
Mouse galaxy::Window::m_mouse |
|
private |
The documentation for this class was generated from the following files: