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
+15 -2
View File
@@ -43,6 +43,7 @@
void init( void );
void display( void );
void reshape( GLFWwindow window, int w, int h );
int window_close_callback(GLFWwindow window);
void DrawBoingBall( void );
void BounceBall( double dt );
void DrawBoingBallBand( GLfloat long_lo, GLfloat long_hi );
@@ -89,6 +90,7 @@ DRAW_BALL_ENUM drawBallHow;
double t;
double t_old = 0.f;
double dt;
static GLboolean running = GL_TRUE;
/* Random number generator */
#ifndef RAND_MAX
@@ -245,6 +247,16 @@ void reshape( GLFWwindow window, int w, int h )
}
/*****************************************************************************
* Window close callback
*****************************************************************************/
int window_close_callback(GLFWwindow window)
{
running = GL_FALSE;
return GL_TRUE;
}
/*****************************************************************************
* Draw the Boing ball.
*
@@ -567,7 +579,6 @@ void DrawGrid( void )
int main( void )
{
int running;
GLFWwindow window;
/* Init GLFW */
@@ -587,6 +598,7 @@ int main( void )
exit( EXIT_FAILURE );
}
glfwSetWindowCloseCallback( window_close_callback );
glfwSetWindowSizeCallback( reshape );
glfwSetInputMode( window, GLFW_STICKY_KEYS, GL_TRUE );
glfwSwapInterval( 1 );
@@ -610,7 +622,8 @@ int main( void )
glfwPollEvents();
/* Check if we are still running */
running = glfwIsWindow(window) && !glfwGetKey( window, GLFW_KEY_ESCAPE );
if (glfwGetKey( window, GLFW_KEY_ESCAPE ))
running = GL_FALSE;
}
while( running );