mirror of
https://github.com/glfw/glfw.git
synced 2026-09-21 00:30:57 +00:00
Move glClear call to context module
This commit is contained in:
+8
-1
@@ -357,7 +357,6 @@ GLFWbool _glfwRefreshContextAttribs(const _GLFWctxconfig* ctxconfig)
|
||||
|
||||
window->GetIntegerv = (PFNGLGETINTEGERVPROC) glfwGetProcAddress("glGetIntegerv");
|
||||
window->GetString = (PFNGLGETSTRINGPROC) glfwGetProcAddress("glGetString");
|
||||
window->Clear = (PFNGLCLEARPROC) glfwGetProcAddress("glClear");
|
||||
|
||||
if (!parseVersionString(&window->context.api,
|
||||
&window->context.major,
|
||||
@@ -470,6 +469,14 @@ GLFWbool _glfwRefreshContextAttribs(const _GLFWctxconfig* ctxconfig)
|
||||
window->context.release = GLFW_RELEASE_BEHAVIOR_FLUSH;
|
||||
}
|
||||
|
||||
// Clearing the front buffer to black to avoid garbage pixels left over from
|
||||
// previous uses of our bit of VRAM
|
||||
{
|
||||
PFNGLCLEARPROC glClear = (PFNGLCLEARPROC) glfwGetProcAddress("glClear");
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
_glfwPlatformSwapBuffers(window);
|
||||
}
|
||||
|
||||
return GLFW_TRUE;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user