Replaced automatic closing with window parameter.

This commit is contained in:
Camilla Berglund
2012-08-10 13:31:15 +02:00
parent 2212cd94bf
commit 2410e2aaf4
21 changed files with 53 additions and 112 deletions
+4 -10
View File
@@ -32,14 +32,6 @@
#include <stdio.h>
#include <stdlib.h>
static GLboolean running = GL_TRUE;
static int window_close_callback(GLFWwindow window)
{
running = GL_FALSE;
return GL_TRUE;
}
static const char* titles[] =
{
"Foo",
@@ -51,6 +43,7 @@ static const char* titles[] =
int main(void)
{
int i;
GLboolean running = GL_TRUE;
GLFWwindow windows[4];
if (!glfwInit())
@@ -60,8 +53,6 @@ int main(void)
exit(EXIT_FAILURE);
}
glfwSetWindowCloseCallback(window_close_callback);
for (i = 0; i < 4; i++)
{
windows[i] = glfwCreateWindow(200, 200, GLFW_WINDOWED, titles[i], NULL);
@@ -88,6 +79,9 @@ int main(void)
glfwMakeContextCurrent(windows[i]);
glClear(GL_COLOR_BUFFER_BIT);
glfwSwapBuffers(windows[i]);
if (glfwGetWindowParam(windows[i], GLFW_CLOSE_REQUESTED))
running = GL_FALSE;
}
glfwPollEvents();