fix: fullscreen resolution error on Windows

This commit is contained in:
2026-04-24 18:01:17 +08:00
parent 106cc3d398
commit 3e27ab675c

View File

@@ -60,7 +60,8 @@ void Window::init() {
m_height = config.get<int>("window.height"); m_height = config.get<int>("window.height");
if (config.get<bool>("window.fullscreen")) { if (config.get<bool>("window.fullscreen")) {
GLFWmonitor* primary_monitor = glfwGetPrimaryMonitor(); GLFWmonitor* primary_monitor = glfwGetPrimaryMonitor();
m_window = glfwCreateWindow(m_width, m_height, "Cubed", primary_monitor, NULL); const GLFWvidmode* mode = glfwGetVideoMode(primary_monitor);
m_window = glfwCreateWindow(mode->width, mode->height, "Cubed", primary_monitor, NULL);
} else { } else {
m_window = glfwCreateWindow(m_width, m_height, "Cubed", NULL, NULL); m_window = glfwCreateWindow(m_width, m_height, "Cubed", NULL, NULL);
} }