Removed glfwIsWindow.

This commit is contained in:
Camilla Berglund
2012-08-03 16:20:52 +02:00
parent 1736132bb2
commit 2972cdfeb1
21 changed files with 111 additions and 66 deletions

View File

@@ -42,6 +42,9 @@ static int rot_x = 0, rot_y = 0, rot_z = 0;
// Do redraw?
static int do_redraw = 1;
// Keep running?
static GLboolean running = GL_TRUE;
//========================================================================
// Draw a solid torus (use a display list for the model)
@@ -435,6 +438,17 @@ static void mouseButtonFun(GLFWwindow window, int button, int action)
}
//========================================================================
// Window close callback function
//========================================================================
static int windowCloseFun(GLFWwindow window)
{
running = GL_FALSE;
return GL_TRUE;
}
//========================================================================
// main
//========================================================================
@@ -470,6 +484,7 @@ int main(void)
glfwSetInputMode(window, GLFW_CURSOR_MODE, GLFW_CURSOR_NORMAL);
// Set callback functions
glfwSetWindowCloseCallback(windowCloseFun);
glfwSetWindowSizeCallback(windowSizeFun);
glfwSetWindowRefreshCallback(windowRefreshFun);
glfwSetCursorPosCallback(cursorPosFun);
@@ -493,9 +508,11 @@ int main(void)
// Wait for new events
glfwWaitEvents();
if (glfwGetKey(window, GLFW_KEY_ESCAPE))
running = GL_FALSE;
} // Check if the ESC key was pressed or the window was closed
while (glfwIsWindow(window) &&
glfwGetKey(window, GLFW_KEY_ESCAPE) != GLFW_PRESS);
while (running);
// Close OpenGL window and terminate GLFW
glfwTerminate();