Replace GLFW window management with OpenGLDevice from engine
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user