mirror of
https://github.com/glfw/glfw.git
synced 2024-11-10 00:51:47 +00:00
Updated example to (sort of) work with the new API.
This commit is contained in:
parent
135194a960
commit
39fd7a5ac1
@ -574,16 +574,17 @@ int main( void )
|
|||||||
exit( EXIT_FAILURE );
|
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" );
|
fprintf( stderr, "Failed to open GLFW window\n" );
|
||||||
glfwTerminate();
|
glfwTerminate();
|
||||||
exit( EXIT_FAILURE );
|
exit( EXIT_FAILURE );
|
||||||
}
|
}
|
||||||
|
|
||||||
glfwSetWindowTitle( "Boing (classic Amiga demo)" );
|
glfwSetWindowTitle( window, "Boing (classic Amiga demo)" );
|
||||||
glfwSetWindowSizeCallback( reshape );
|
glfwSetWindowSizeCallback( window, reshape );
|
||||||
glfwEnable( GLFW_STICKY_KEYS );
|
glfwEnable( window, GLFW_STICKY_KEYS );
|
||||||
glfwSwapInterval( 1 );
|
glfwSwapInterval( 1 );
|
||||||
glfwSetTime( 0.0 );
|
glfwSetTime( 0.0 );
|
||||||
|
|
||||||
@ -602,10 +603,10 @@ int main( void )
|
|||||||
|
|
||||||
/* Swap buffers */
|
/* Swap buffers */
|
||||||
glfwSwapBuffers();
|
glfwSwapBuffers();
|
||||||
|
glfwPollEvents();
|
||||||
|
|
||||||
/* Check if we are still running */
|
/* Check if we are still running */
|
||||||
running = !glfwGetKey( GLFW_KEY_ESC ) &&
|
running = !glfwGetKey( window, GLFW_KEY_ESC );
|
||||||
glfwGetWindowParam( GLFW_OPENED );
|
|
||||||
}
|
}
|
||||||
while( running );
|
while( running );
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user