Updated example to (sort of) work with the new API.

This commit is contained in:
Camilla Berglund 2010-09-09 18:16:07 +02:00
parent 135194a960
commit 39fd7a5ac1

View File

@ -574,16 +574,17 @@ int main( void )
exit( EXIT_FAILURE );
}
if( !glfwOpenWindow( 400,400, 0,0,0,0, 16,0, GLFW_WINDOW ) )
GLFWwindow window = glfwOpenWindow( 400,400, 0,0,0,0, 16,0, GLFW_WINDOW );
if (!window)
{
fprintf( stderr, "Failed to open GLFW window\n" );
glfwTerminate();
exit( EXIT_FAILURE );
}
glfwSetWindowTitle( "Boing (classic Amiga demo)" );
glfwSetWindowSizeCallback( reshape );
glfwEnable( GLFW_STICKY_KEYS );
glfwSetWindowTitle( window, "Boing (classic Amiga demo)" );
glfwSetWindowSizeCallback( window, reshape );
glfwEnable( window, GLFW_STICKY_KEYS );
glfwSwapInterval( 1 );
glfwSetTime( 0.0 );
@ -602,10 +603,10 @@ int main( void )
/* Swap buffers */
glfwSwapBuffers();
glfwPollEvents();
/* Check if we are still running */
running = !glfwGetKey( GLFW_KEY_ESC ) &&
glfwGetWindowParam( GLFW_OPENED );
running = !glfwGetKey( window, GLFW_KEY_ESC );
}
while( running );