mirror of
https://github.com/glfw/glfw.git
synced 2025-10-03 13:20:58 +00:00
Merge 5297e07278
into ce0e74f6a9
This commit is contained in:
commit
46655e24ab
@ -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 );
|
||||||
}
|
}
|
||||||
|
@ -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);
|
||||||
|
@ -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;
|
||||||
|
@ -61,6 +61,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;
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -240,11 +240,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
|
|
||||||
glClear(GL_COLOR_BUFFER_BIT);
|
|
||||||
_glfwPlatformSwapBuffers(window);
|
|
||||||
|
|
||||||
// Restore the previously current context (or NULL)
|
// Restore the previously current context (or NULL)
|
||||||
_glfwPlatformMakeContextCurrent(previous);
|
_glfwPlatformMakeContextCurrent(previous);
|
||||||
|
|
||||||
|
@ -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);
|
||||||
|
@ -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))
|
||||||
{
|
{
|
||||||
|
@ -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);
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
|
@ -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();
|
||||||
|
@ -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))
|
||||||
{
|
{
|
||||||
|
@ -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);
|
||||||
|
@ -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);
|
||||||
|
@ -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)
|
||||||
{
|
{
|
||||||
|
@ -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))
|
||||||
{
|
{
|
||||||
|
@ -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)
|
||||||
{
|
{
|
||||||
|
@ -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);
|
||||||
|
@ -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);
|
||||||
|
@ -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);
|
||||||
|
@ -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],
|
||||||
|
Loading…
Reference in New Issue
Block a user