SolarSim
Loading...
Searching...
No Matches
window.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <GLFW/glfw3.h>
4
5namespace solarsim {
6
13 class Window {
14 public:
23 Window(const uint32_t p_width = 800, const uint32_t p_height = 600, const char* p_title = "solarsim");
24 ~Window();
25
30 bool shouldClose() { return glfwWindowShouldClose(m_window); }
31
36 void swapBuffers() { glfwSwapBuffers(m_window); }
37
42 void pollEvents() { glfwPollEvents(); }
43
48 GLFWwindow* getNativeWindow() const { return m_window; }
49 private:
51 GLFWwindow* m_window;
52
61 static void framebuffer_size_callback(GLFWwindow* w, int p_width, int p_height);
62 };
63}
~Window()
Definition window.cpp:39
static void framebuffer_size_callback(GLFWwindow *w, int p_width, int p_height)
GLFW framebuffer resize callback.
Definition window.cpp:43
Window(const uint32_t p_width=800, const uint32_t p_height=600, const char *p_title="solarsim")
Create a new window.
Definition window.cpp:15
GLFWwindow * getNativeWindow() const
Get native GLFW window handle.
Definition window.hpp:48
void swapBuffers()
Swap front and back buffers.
Definition window.hpp:36
void pollEvents()
Process pending window events.
Definition window.hpp:42
GLFWwindow * m_window
Definition window.hpp:51
bool shouldClose()
Check if window should close.
Definition window.hpp:30
Definition engine.cpp:23