Replace GLFW window management with OpenGLDevice from engine

This commit is contained in:
2026-03-16 18:06:57 +08:00
parent 220494c3c5
commit 430d23b719
2 changed files with 29 additions and 25 deletions

View File

@@ -21,6 +21,12 @@ bool OpenGLDevice::CreateRenderWindow(int width, int height, const char* title,
return true;
}
static bool glfwInitialized = false;
if (!glfwInitialized) {
glfwInit();
glfwInitialized = true;
}
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
@@ -30,6 +36,8 @@ bool OpenGLDevice::CreateRenderWindow(int width, int height, const char* title,
return false;
}
glfwSetWindowShouldClose(m_window, GLFW_FALSE);
m_ownsWindow = true;
return InitializeWithExistingWindow(m_window);
}