Manages window creation, events, and GLFW context.
More...
#include <window.hpp>
|
| | Window (const uint32_t p_width=800, const uint32_t p_height=600, const char *p_title="solarsim") |
| | Create a new window.
|
| | ~Window () |
| bool | shouldClose () |
| | Check if window should close.
|
| void | swapBuffers () |
| | Swap front and back buffers.
|
| void | pollEvents () |
| | Process pending window events.
|
| GLFWwindow * | getNativeWindow () const |
| | Get native GLFW window handle.
|
Manages window creation, events, and GLFW context.
- Note
- Wraps GLFW window functionality
- Warning
- GLFW must be initialized before creating Window instances
◆ Window()
| solarsim::Window::Window |
( |
const uint32_t | p_width = 800, |
|
|
const uint32_t | p_height = 600, |
|
|
const char * | p_title = "solarsim" ) |
Create a new window.
- Parameters
-
- Exceptions
-
| std::runtime_error | if window creation fails |
◆ ~Window()
| solarsim::Window::~Window |
( |
| ) |
|
◆ framebuffer_size_callback()
| void solarsim::Window::framebuffer_size_callback |
( |
GLFWwindow * | w, |
|
|
int | p_width, |
|
|
int | p_height ) |
|
staticprivate |
GLFW framebuffer resize callback.
- Parameters
-
| w | GLFW window that was resized |
| p_width | New framebuffer width |
| p_height | New framebuffer height |
- Note
- Updates the aspect ratio of the primary camera if present
Update camera aspect ratio if found
◆ getNativeWindow()
| GLFWwindow * solarsim::Window::getNativeWindow |
( |
| ) |
const |
|
inline |
Get native GLFW window handle.
- Returns
- GLFWwindow* Raw GLFW window pointer
◆ pollEvents()
| void solarsim::Window::pollEvents |
( |
| ) |
|
|
inline |
Process pending window events.
- Note
- Call this once per frame before rendering
◆ shouldClose()
| bool solarsim::Window::shouldClose |
( |
| ) |
|
|
inline |
Check if window should close.
- Returns
- bool True if window close requested
◆ swapBuffers()
| void solarsim::Window::swapBuffers |
( |
| ) |
|
|
inline |
Swap front and back buffers.
- Note
- Call this once per frame after rendering
◆ m_window
| GLFWwindow* solarsim::Window::m_window |
|
private |
Native GLFW window handle
The documentation for this class was generated from the following files: