diff options
| author | Mel <einebeere@gmail.com> | 2024-02-15 11:18:17 +0100 |
|---|---|---|
| committer | Mel <einebeere@gmail.com> | 2024-02-15 11:18:17 +0100 |
| commit | 0a5e412541937ead88377cabdb565ecfe65c0afc (patch) | |
| tree | cf2daa159cf466ab50d639bdb209e8603e763138 /src/GFX | |
| parent | 6a30c3e4f22de4d0f8f32107f614f597f5f39cc1 (diff) | |
| download | meowcraft-0a5e412541937ead88377cabdb565ecfe65c0afc.tar.zst meowcraft-0a5e412541937ead88377cabdb565ecfe65c0afc.zip | |
Give all threads specific thread roles and assert thread safety
Diffstat (limited to 'src/GFX')
| -rw-r--r-- | src/GFX/Window.cpp | 7 |
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(); } |
