diff --git a/examples/boing.c b/examples/boing.c index ec313596a..4f612797d 100644 --- a/examples/boing.c +++ b/examples/boing.c @@ -201,7 +201,7 @@ void init( void ) /* * Clear background. */ - glClearColor( 0.55f, 0.55f, 0.55f, 0.f ); + glClearColor( 0.55f, 0.55f, 0.55f, 0.5f ); glShadeModel( GL_FLAT ); } diff --git a/examples/gears.c b/examples/gears.c index 2d4459645..566054522 100644 --- a/examples/gears.c +++ b/examples/gears.c @@ -278,6 +278,8 @@ static void init(int argc, char *argv[]) glEnable(GL_LIGHT0); glEnable(GL_DEPTH_TEST); + glClearColor(0.f, 0.f, 0.f, 0.7f); + /* make the gears */ gear1 = glGenLists(1); glNewList(gear1, GL_COMPILE); diff --git a/examples/heightmap.c b/examples/heightmap.c index e7e35b4f8..ab2a19e43 100644 --- a/examples/heightmap.c +++ b/examples/heightmap.c @@ -562,7 +562,7 @@ int main(int argc, char** argv) /* setup the scene ready for rendering */ glViewport(0, 0, 800, 600); - glClearColor(0.0f, 0.0f, 0.0f, 0.0f); + glClearColor(0.f, 0.f, 0.f, 1.f); /* main loop */ frame = 0; diff --git a/examples/simple.c b/examples/simple.c index c39be5742..01ab3b2e3 100644 --- a/examples/simple.c +++ b/examples/simple.c @@ -61,6 +61,8 @@ int main(void) glfwSetKeyCallback(window, key_callback); + glClearColor(0.f, 0.f, 0.f, 0.7f); + while (!glfwWindowShouldClose(window)) { float ratio; diff --git a/examples/wave.c b/examples/wave.c index 6890e85cd..fd0544048 100644 --- a/examples/wave.c +++ b/examples/wave.c @@ -185,7 +185,7 @@ void init_opengl(void) glPointSize(2.0); // Background color is black - glClearColor(0, 0, 0, 0); + glClearColor(0.f, 0.f, 0.f, 1.f); } diff --git a/src/window.c b/src/window.c index 561671e15..af3656735 100644 --- a/src/window.c +++ b/src/window.c @@ -240,11 +240,6 @@ GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height, return NULL; } - // Clearing the front buffer to black to avoid garbage pixels left over - // from previous uses of our bit of VRAM - glClear(GL_COLOR_BUFFER_BIT); - _glfwPlatformSwapBuffers(window); - // Restore the previously current context (or NULL) _glfwPlatformMakeContextCurrent(previous); diff --git a/tests/accuracy.c b/tests/accuracy.c index 6a63c889e..25bdd256f 100644 --- a/tests/accuracy.c +++ b/tests/accuracy.c @@ -107,6 +107,8 @@ int main(void) set_swap_interval(window, swap_interval); + glClearColor(0.f, 0.f, 0.f, 1.f); + while (!glfwWindowShouldClose(window)) { glClear(GL_COLOR_BUFFER_BIT); diff --git a/tests/clipboard.c b/tests/clipboard.c index 43422845f..27335f5e3 100644 --- a/tests/clipboard.c +++ b/tests/clipboard.c @@ -130,7 +130,7 @@ int main(int argc, char** argv) glOrtho(-1.f, 1.f, -1.f, 1.f, -1.f, 1.f); glMatrixMode(GL_MODELVIEW); - glClearColor(0.5f, 0.5f, 0.5f, 0); + glClearColor(0.5f, 0.5f, 0.5f, 1.f); while (!glfwWindowShouldClose(window)) { diff --git a/tests/cursoranim.c b/tests/cursoranim.c index 39a229c85..6f960c1fa 100644 --- a/tests/cursoranim.c +++ b/tests/cursoranim.c @@ -111,6 +111,8 @@ int main(void) t0 = glfwGetTime(); + glClearColor(0.f, 0.f, 0.f, 1.f); + while (!glfwWindowShouldClose(window)) { glClear(GL_COLOR_BUFFER_BIT); diff --git a/tests/events.c b/tests/events.c index fda681641..19f4a10e1 100644 --- a/tests/events.c +++ b/tests/events.c @@ -304,6 +304,7 @@ static void window_refresh_callback(GLFWwindow* window) counter++, slot->number, glfwGetTime()); glfwMakeContextCurrent(window); + glClearColor(0.f, 0.f, 0.f, 1.f); glClear(GL_COLOR_BUFFER_BIT); glfwSwapBuffers(window); } diff --git a/tests/fsaa.c b/tests/fsaa.c index ef7843903..a740f4849 100644 --- a/tests/fsaa.c +++ b/tests/fsaa.c @@ -127,6 +127,8 @@ int main(int argc, char** argv) glOrtho(0.f, 1.f, 0.f, 0.5f, 0.f, 1.f); glMatrixMode(GL_MODELVIEW); + glClearColor(0.f, 0.f, 0.f, 1.f); + while (!glfwWindowShouldClose(window)) { GLfloat time = (GLfloat) glfwGetTime(); diff --git a/tests/gamma.c b/tests/gamma.c index c67e128a2..b9b6e4060 100644 --- a/tests/gamma.c +++ b/tests/gamma.c @@ -162,7 +162,7 @@ int main(int argc, char** argv) glOrtho(-1.f, 1.f, -1.f, 1.f, -1.f, 1.f); glMatrixMode(GL_MODELVIEW); - glClearColor(0.5f, 0.5f, 0.5f, 0); + glClearColor(0.5f, 0.5f, 0.5f, 1.f); while (!glfwWindowShouldClose(window)) { diff --git a/tests/iconify.c b/tests/iconify.c index 3cdfd0781..5fdf7bbe4 100644 --- a/tests/iconify.c +++ b/tests/iconify.c @@ -165,11 +165,11 @@ int main(int argc, char** argv) glfwGetFramebufferSize(window, &width, &height); glScissor(0, 0, width, height); - glClearColor(0, 0, 0, 0); + glClearColor(0.f, 0.f, 0.f, 1.f); glClear(GL_COLOR_BUFFER_BIT); glScissor(0, 0, 640, 480); - glClearColor(1, 1, 1, 0); + glClearColor(1.f, 1.f, 1.f, 1.f); glClear(GL_COLOR_BUFFER_BIT); glfwSwapBuffers(window); diff --git a/tests/joysticks.c b/tests/joysticks.c index a3a5cd7e7..8b4656838 100644 --- a/tests/joysticks.c +++ b/tests/joysticks.c @@ -217,6 +217,8 @@ int main(void) glfwMakeContextCurrent(window); glfwSwapInterval(1); + glClearColor(0.f, 0.f, 0.f, 1.f); + while (!glfwWindowShouldClose(window)) { glClear(GL_COLOR_BUFFER_BIT); diff --git a/tests/modes.c b/tests/modes.c index 58067e3ea..2dba7f38f 100644 --- a/tests/modes.c +++ b/tests/modes.c @@ -151,6 +151,7 @@ static void test_modes(GLFWmonitor* monitor) glfwSwapInterval(1); glfwSetTime(0.0); + glClearColor(0.f, 0.f, 0.f, 1.f); while (glfwGetTime() < 5.0) { diff --git a/tests/peter.c b/tests/peter.c index 4eab10f0b..e3def854d 100644 --- a/tests/peter.c +++ b/tests/peter.c @@ -116,7 +116,7 @@ int main(void) exit(EXIT_FAILURE); } - glClearColor(0.f, 0.f, 0.f, 0.f); + glClearColor(0.f, 0.f, 0.f, 1.f); while (!glfwWindowShouldClose(window)) { diff --git a/tests/reopen.c b/tests/reopen.c index ca79eed60..f24d9a7c6 100644 --- a/tests/reopen.c +++ b/tests/reopen.c @@ -143,6 +143,7 @@ int main(int argc, char** argv) glMatrixMode(GL_MODELVIEW); glfwSetTime(0.0); + glClearColor(0.f, 0.f, 0.f, 1.f); while (glfwGetTime() < 5.0) { diff --git a/tests/tearing.c b/tests/tearing.c index 94865fab2..ff7fc6ef6 100644 --- a/tests/tearing.c +++ b/tests/tearing.c @@ -102,6 +102,8 @@ int main(void) glOrtho(-1.f, 1.f, -1.f, 1.f, 1.f, -1.f); glMatrixMode(GL_MODELVIEW); + glClearColor(0.f, 0.f, 0.f, 1.f); + while (!glfwWindowShouldClose(window)) { glClear(GL_COLOR_BUFFER_BIT); diff --git a/tests/threads.c b/tests/threads.c index 78519c73d..0b31b1dc7 100644 --- a/tests/threads.c +++ b/tests/threads.c @@ -61,7 +61,7 @@ static int thread_main(void* data) while (running) { const float v = (float) fabs(sin(glfwGetTime() * 2.f)); - glClearColor(thread->r * v, thread->g * v, thread->b * v, 0.f); + glClearColor(thread->r * v, thread->g * v, thread->b * v, 1.f); glClear(GL_COLOR_BUFFER_BIT); glfwSwapBuffers(thread->window); diff --git a/tests/title.c b/tests/title.c index 15ddb83fa..82b663f9c 100644 --- a/tests/title.c +++ b/tests/title.c @@ -63,6 +63,8 @@ int main(void) glfwSetFramebufferSizeCallback(window, framebuffer_size_callback); + glClearColor(0.f, 0.f, 0.f, 1.f); + while (!glfwWindowShouldClose(window)) { glClear(GL_COLOR_BUFFER_BIT); diff --git a/tests/windows.c b/tests/windows.c index 164a298f1..44842a3b4 100644 --- a/tests/windows.c +++ b/tests/windows.c @@ -85,7 +85,7 @@ int main(void) glClearColor((GLclampf) (i & 1), (GLclampf) (i >> 1), i ? 0.f : 1.f, - 0.f); + 1.f); glfwGetWindowFrameSize(windows[i], &left, &top, &right, &bottom); glfwSetWindowPos(windows[i],