summary refs log tree commit diff
path: root/src/GFX
diff options
context:
space:
mode:
Diffstat (limited to 'src/GFX')
-rw-r--r--src/GFX/Window.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/GFX/Window.cpp b/src/GFX/Window.cpp
index c0c5b03..33e76d5 100644
--- a/src/GFX/Window.cpp
+++ b/src/GFX/Window.cpp
@@ -1,12 +1,13 @@
 #include <stdexcept>
 #include "../Common/Sizes.hpp"
-#include "Window.hpp"
-
 #include "../Common/Assert.hpp"
+#include "../ThreadRole.hpp"
+#include "Window.hpp"
 
 namespace MC::GFX {
 
 Window::Window(const Char* title, U32 width, U32 height) {
+    ASSERT_MAIN_THREAD();
     glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
     glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
     glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
@@ -23,6 +24,7 @@ Window::Window(const Char* title, U32 width, U32 height) {
 }
 
 Window::~Window() {
+    ASSERT_MAIN_THREAD();
     glfwDestroyWindow(m_window);
 }
 
@@ -55,6 +57,7 @@ void Window::start_render() {
 }
 
 void Window::poll_events() {
+    ASSERT_MAIN_THREAD();
     glfwPollEvents();
 }