examples/tests: set window background to black

This commit is contained in:
Ricardo Vieira 2014-08-28 01:26:53 +01:00
parent a12f41d44c
commit 5297e07278
20 changed files with 29 additions and 10 deletions

View File

@ -201,7 +201,7 @@ void init( void )
/* /*
* Clear background. * Clear background.
*/ */
glClearColor( 0.55f, 0.55f, 0.55f, 0.f ); glClearColor( 0.55f, 0.55f, 0.55f, 0.5f );
glShadeModel( GL_FLAT ); glShadeModel( GL_FLAT );
} }

View File

@ -278,6 +278,8 @@ static void init(int argc, char *argv[])
glEnable(GL_LIGHT0); glEnable(GL_LIGHT0);
glEnable(GL_DEPTH_TEST); glEnable(GL_DEPTH_TEST);
glClearColor(0.f, 0.f, 0.f, 0.7f);
/* make the gears */ /* make the gears */
gear1 = glGenLists(1); gear1 = glGenLists(1);
glNewList(gear1, GL_COMPILE); glNewList(gear1, GL_COMPILE);

View File

@ -562,7 +562,7 @@ int main(int argc, char** argv)
/* setup the scene ready for rendering */ /* setup the scene ready for rendering */
glViewport(0, 0, 800, 600); 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 */ /* main loop */
frame = 0; frame = 0;

View File

@ -60,6 +60,8 @@ int main(void)
glfwSetKeyCallback(window, key_callback); glfwSetKeyCallback(window, key_callback);
glClearColor(0.f, 0.f, 0.f, 0.7f);
while (!glfwWindowShouldClose(window)) while (!glfwWindowShouldClose(window))
{ {
float ratio; float ratio;

View File

@ -185,7 +185,7 @@ void init_opengl(void)
glPointSize(2.0); glPointSize(2.0);
// Background color is black // Background color is black
glClearColor(0, 0, 0, 0); glClearColor(0.f, 0.f, 0.f, 1.f);
} }

View File

@ -107,6 +107,8 @@ int main(void)
set_swap_interval(window, swap_interval); set_swap_interval(window, swap_interval);
glClearColor(0.f, 0.f, 0.f, 1.f);
while (!glfwWindowShouldClose(window)) while (!glfwWindowShouldClose(window))
{ {
glClear(GL_COLOR_BUFFER_BIT); glClear(GL_COLOR_BUFFER_BIT);

View File

@ -130,7 +130,7 @@ int main(int argc, char** argv)
glOrtho(-1.f, 1.f, -1.f, 1.f, -1.f, 1.f); glOrtho(-1.f, 1.f, -1.f, 1.f, -1.f, 1.f);
glMatrixMode(GL_MODELVIEW); glMatrixMode(GL_MODELVIEW);
glClearColor(0.5f, 0.5f, 0.5f, 0); glClearColor(0.5f, 0.5f, 0.5f, 1.f);
while (!glfwWindowShouldClose(window)) while (!glfwWindowShouldClose(window))
{ {

View File

@ -111,6 +111,8 @@ int main(void)
t0 = glfwGetTime(); t0 = glfwGetTime();
glClearColor(0.f, 0.f, 0.f, 1.f);
while (!glfwWindowShouldClose(window)) while (!glfwWindowShouldClose(window))
{ {
glClear(GL_COLOR_BUFFER_BIT); glClear(GL_COLOR_BUFFER_BIT);

View File

@ -304,6 +304,7 @@ static void window_refresh_callback(GLFWwindow* window)
counter++, slot->number, glfwGetTime()); counter++, slot->number, glfwGetTime());
glfwMakeContextCurrent(window); glfwMakeContextCurrent(window);
glClearColor(0.f, 0.f, 0.f, 1.f);
glClear(GL_COLOR_BUFFER_BIT); glClear(GL_COLOR_BUFFER_BIT);
glfwSwapBuffers(window); glfwSwapBuffers(window);
} }

View File

@ -127,6 +127,8 @@ int main(int argc, char** argv)
glOrtho(0.f, 1.f, 0.f, 0.5f, 0.f, 1.f); glOrtho(0.f, 1.f, 0.f, 0.5f, 0.f, 1.f);
glMatrixMode(GL_MODELVIEW); glMatrixMode(GL_MODELVIEW);
glClearColor(0.f, 0.f, 0.f, 1.f);
while (!glfwWindowShouldClose(window)) while (!glfwWindowShouldClose(window))
{ {
GLfloat time = (GLfloat) glfwGetTime(); GLfloat time = (GLfloat) glfwGetTime();

View File

@ -162,7 +162,7 @@ int main(int argc, char** argv)
glOrtho(-1.f, 1.f, -1.f, 1.f, -1.f, 1.f); glOrtho(-1.f, 1.f, -1.f, 1.f, -1.f, 1.f);
glMatrixMode(GL_MODELVIEW); glMatrixMode(GL_MODELVIEW);
glClearColor(0.5f, 0.5f, 0.5f, 0); glClearColor(0.5f, 0.5f, 0.5f, 1.f);
while (!glfwWindowShouldClose(window)) while (!glfwWindowShouldClose(window))
{ {

View File

@ -165,11 +165,11 @@ int main(int argc, char** argv)
glfwGetFramebufferSize(window, &width, &height); glfwGetFramebufferSize(window, &width, &height);
glScissor(0, 0, 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); glClear(GL_COLOR_BUFFER_BIT);
glScissor(0, 0, 640, 480); glScissor(0, 0, 640, 480);
glClearColor(1, 1, 1, 0); glClearColor(1.f, 1.f, 1.f, 1.f);
glClear(GL_COLOR_BUFFER_BIT); glClear(GL_COLOR_BUFFER_BIT);
glfwSwapBuffers(window); glfwSwapBuffers(window);

View File

@ -217,6 +217,8 @@ int main(void)
glfwMakeContextCurrent(window); glfwMakeContextCurrent(window);
glfwSwapInterval(1); glfwSwapInterval(1);
glClearColor(0.f, 0.f, 0.f, 1.f);
while (!glfwWindowShouldClose(window)) while (!glfwWindowShouldClose(window))
{ {
glClear(GL_COLOR_BUFFER_BIT); glClear(GL_COLOR_BUFFER_BIT);

View File

@ -151,6 +151,7 @@ static void test_modes(GLFWmonitor* monitor)
glfwSwapInterval(1); glfwSwapInterval(1);
glfwSetTime(0.0); glfwSetTime(0.0);
glClearColor(0.f, 0.f, 0.f, 1.f);
while (glfwGetTime() < 5.0) while (glfwGetTime() < 5.0)
{ {

View File

@ -116,7 +116,7 @@ int main(void)
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
glClearColor(0.f, 0.f, 0.f, 0.f); glClearColor(0.f, 0.f, 0.f, 1.f);
while (!glfwWindowShouldClose(window)) while (!glfwWindowShouldClose(window))
{ {

View File

@ -143,6 +143,7 @@ int main(int argc, char** argv)
glMatrixMode(GL_MODELVIEW); glMatrixMode(GL_MODELVIEW);
glfwSetTime(0.0); glfwSetTime(0.0);
glClearColor(0.f, 0.f, 0.f, 1.f);
while (glfwGetTime() < 5.0) while (glfwGetTime() < 5.0)
{ {

View File

@ -102,6 +102,8 @@ int main(void)
glOrtho(-1.f, 1.f, -1.f, 1.f, 1.f, -1.f); glOrtho(-1.f, 1.f, -1.f, 1.f, 1.f, -1.f);
glMatrixMode(GL_MODELVIEW); glMatrixMode(GL_MODELVIEW);
glClearColor(0.f, 0.f, 0.f, 1.f);
while (!glfwWindowShouldClose(window)) while (!glfwWindowShouldClose(window))
{ {
glClear(GL_COLOR_BUFFER_BIT); glClear(GL_COLOR_BUFFER_BIT);

View File

@ -61,7 +61,7 @@ static int thread_main(void* data)
while (running) while (running)
{ {
const float v = (float) fabs(sin(glfwGetTime() * 2.f)); 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); glClear(GL_COLOR_BUFFER_BIT);
glfwSwapBuffers(thread->window); glfwSwapBuffers(thread->window);

View File

@ -63,6 +63,8 @@ int main(void)
glfwSetFramebufferSizeCallback(window, framebuffer_size_callback); glfwSetFramebufferSizeCallback(window, framebuffer_size_callback);
glClearColor(0.f, 0.f, 0.f, 1.f);
while (!glfwWindowShouldClose(window)) while (!glfwWindowShouldClose(window))
{ {
glClear(GL_COLOR_BUFFER_BIT); glClear(GL_COLOR_BUFFER_BIT);

View File

@ -85,7 +85,7 @@ int main(void)
glClearColor((GLclampf) (i & 1), glClearColor((GLclampf) (i & 1),
(GLclampf) (i >> 1), (GLclampf) (i >> 1),
i ? 0.f : 1.f, i ? 0.f : 1.f,
0.f); 1.f);
glfwGetWindowFrameSize(windows[i], &left, &top, &right, &bottom); glfwGetWindowFrameSize(windows[i], &left, &top, &right, &bottom);
glfwSetWindowPos(windows[i], glfwSetWindowPos(windows[i],