mirror of
https://github.com/glfw/glfw.git
synced 2024-11-11 13:03:52 +00:00
Move glClear call to context module
This commit is contained in:
parent
678cc54c44
commit
f5855968bb
@ -357,7 +357,6 @@ GLFWbool _glfwRefreshContextAttribs(const _GLFWctxconfig* ctxconfig)
|
|||||||
|
|
||||||
window->GetIntegerv = (PFNGLGETINTEGERVPROC) glfwGetProcAddress("glGetIntegerv");
|
window->GetIntegerv = (PFNGLGETINTEGERVPROC) glfwGetProcAddress("glGetIntegerv");
|
||||||
window->GetString = (PFNGLGETSTRINGPROC) glfwGetProcAddress("glGetString");
|
window->GetString = (PFNGLGETSTRINGPROC) glfwGetProcAddress("glGetString");
|
||||||
window->Clear = (PFNGLCLEARPROC) glfwGetProcAddress("glClear");
|
|
||||||
|
|
||||||
if (!parseVersionString(&window->context.api,
|
if (!parseVersionString(&window->context.api,
|
||||||
&window->context.major,
|
&window->context.major,
|
||||||
@ -470,6 +469,14 @@ GLFWbool _glfwRefreshContextAttribs(const _GLFWctxconfig* ctxconfig)
|
|||||||
window->context.release = GLFW_RELEASE_BEHAVIOR_FLUSH;
|
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;
|
return GLFW_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -271,7 +271,6 @@ struct _GLFWwindow
|
|||||||
PFNGLGETSTRINGIPROC GetStringi;
|
PFNGLGETSTRINGIPROC GetStringi;
|
||||||
PFNGLGETINTEGERVPROC GetIntegerv;
|
PFNGLGETINTEGERVPROC GetIntegerv;
|
||||||
PFNGLGETSTRINGPROC GetString;
|
PFNGLGETSTRINGPROC GetString;
|
||||||
PFNGLCLEARPROC Clear;
|
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
GLFWwindowposfun pos;
|
GLFWwindowposfun pos;
|
||||||
|
@ -200,11 +200,6 @@ GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height,
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clearing the front buffer to black to avoid garbage pixels left over
|
|
||||||
// from previous uses of our bit of VRAM
|
|
||||||
window->Clear(GL_COLOR_BUFFER_BIT);
|
|
||||||
_glfwPlatformSwapBuffers(window);
|
|
||||||
|
|
||||||
// Restore the previously current context (or NULL)
|
// Restore the previously current context (or NULL)
|
||||||
_glfwPlatformMakeContextCurrent(previous);
|
_glfwPlatformMakeContextCurrent(previous);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user