From 39fd7a5ac144effb1b5739f899d9ac25b28172e2 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Thu, 9 Sep 2010 18:16:07 +0200 Subject: [PATCH] Updated example to (sort of) work with the new API. --- examples/boing.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/examples/boing.c b/examples/boing.c index 451445b0..c060e4fb 100644 --- a/examples/boing.c +++ b/examples/boing.c @@ -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 );