I'm reading OpenGL Superbible 4th ed. In Chapter 2, the example code sets up the callback followed by the clear color as follows:
main()
{
//...
glDisplayFunc(RenderScene);
SetupRC();
//..
}
void RenderScene(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glFlush();
}
void SetupRC(void)
{
glClearColor(0.0f, 0.0f, 1.0f, 1.0f);
}
Is it posisble that we have a race condition here, where glClear
might be executed before glClearColor
?