Deep Learning Visualizer
Interactive visualization of basic applications of deep learning
Loading...
Searching...
No Matches
window.h
Go to the documentation of this file.
1#pragma once
2
6#include <glad/glad.h>
7
8#include <GLFW/glfw3.h>
9
10namespace engine {
11
15class window {
16public:
22 explicit window(input::event_bus &bus);
23
27 ~window();
28
29 window(const window &) = delete;
30 window(window &&) = delete;
31 window &operator=(const window &) = delete;
32 window &operator=(window &&) = delete;
33
37 [[nodiscard]] bool should_close() const {
38 return glfwWindowShouldClose(base_window_);
39 }
40
44 void wait_events() {
45 glfwWaitEvents();
46 }
47
51 void swap_buffers() {
52 glfwSwapBuffers(base_window_);
53 }
54
55private:
56 GLFWwindow *base_window_{nullptr};
57
58 static constexpr int UI_SCALE{30};
59};
60
61} // namespace engine
An event dispatcher for input events.
Definition event_bus.h:15
A GLFW window manager.
Definition window.h:15
void wait_events()
Blocks the current theread until there is a new window event.
Definition window.h:44
void swap_buffers()
Switches to the newly rendered frame.
Definition window.h:51
bool should_close() const
Returns true if the GLFW window should be closed.
Definition window.h:37
~window()
Destructor that cleans up GLFW resources.
Definition window.cpp:73