diff --git a/cbt/opengl/context.cpp b/cbt/opengl/context.cpp index 47c692e..770aa7c 100644 --- a/cbt/opengl/context.cpp +++ b/cbt/opengl/context.cpp @@ -1,7 +1,18 @@ #include +#ifdef _WIN32 +#include +#include +#endif + #define GLFW_INCLUDE_NONE #include "GLFW/glfw3.h" + +#ifdef _WIN32 +#define GLFW_EXPOSE_NATIVE_WIN32 +#include "GLFW/glfw3native.h" +#endif + #include "fmt/std.h" #include "glad/glad.h" @@ -58,6 +69,12 @@ context::context(std::string title, int width, int height) { glfwMakeContextCurrent(m_window); +#ifdef _WIN32 + auto hwnd = glfwGetWin32Window(static_cast(m_window)); + BOOL use_dark_mode = TRUE; + DwmSetWindowAttribute(hwnd, DWMWA_USE_IMMERSIVE_DARK_MODE, &use_dark_mode, sizeof(use_dark_mode)); +#endif + if (!setup_gl()) { terminate(); return;