Chess Engine
A Chess Engine project written in C++.
Loading...
Searching...
No Matches
glfw_wrapper.hpp
1#pragma once
2
3#include <GLFW/glfw3.h>
4
5#include <string>
6
8 public:
9 void initialize(int width, int height, const char *title, bool use_vsync);
10 void terminate();
11
12 void updateDimensions();
13 void beginFrame();
14 void fillFrame(float r, float g, float b, float a) const;
15 void finishFrame() const;
16
17 bool windowShouldClose() { return glfwWindowShouldClose(m_window) != 0; };
18 void setWindowShouldClose(bool value) { glfwSetWindowShouldClose(m_window, static_cast<int>(value)); }
19
20 [[nodiscard]] int width() const noexcept { return m_width; }
21 [[nodiscard]] int height() const noexcept { return m_height; }
22 [[nodiscard]] GLFWwindow *window() const noexcept { return m_window; }
23 [[nodiscard]] static double time() noexcept { return glfwGetTime(); }
24 [[nodiscard]] bool shouldClose() { return glfwWindowShouldClose(m_window) != 0; }
25
26 private:
27 int m_width, m_height;
28 bool m_use_vsync;
29 std::string m_title;
30
31 GLFWmonitor *m_monitor;
32 GLFWwindow *m_window;
33
34 bool m_initialized;
35};
Definition glfw_wrapper.hpp:7
Definition imgui_wrapper.hpp:12