mirror of
https://github.com/glfw/glfw.git
synced 2026-11-18 12:54:54 +00:00
Removed calling of callbacks from setters.
This commit is contained in:
+9
-5
@@ -330,6 +330,7 @@ static void init(int argc, char *argv[])
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
GLFWwindow window;
|
||||
int width, height;
|
||||
|
||||
if( !glfwInit() )
|
||||
{
|
||||
@@ -337,6 +338,11 @@ int main(int argc, char *argv[])
|
||||
exit( EXIT_FAILURE );
|
||||
}
|
||||
|
||||
// Set callback functions
|
||||
glfwSetWindowCloseCallback(window_close_callback);
|
||||
glfwSetWindowSizeCallback( reshape );
|
||||
glfwSetKeyCallback( key );
|
||||
|
||||
glfwWindowHint(GLFW_DEPTH_BITS, 16);
|
||||
|
||||
window = glfwCreateWindow( 300, 300, GLFW_WINDOWED, "Gears", NULL );
|
||||
@@ -347,17 +353,15 @@ int main(int argc, char *argv[])
|
||||
exit( EXIT_FAILURE );
|
||||
}
|
||||
|
||||
glfwGetWindowSize(window, &width, &height);
|
||||
reshape(window, width, height);
|
||||
|
||||
glfwSetInputMode( window, GLFW_KEY_REPEAT, GL_TRUE );
|
||||
glfwSwapInterval( 1 );
|
||||
|
||||
// Parse command-line options
|
||||
init(argc, argv);
|
||||
|
||||
// Set callback functions
|
||||
glfwSetWindowCloseCallback(window_close_callback);
|
||||
glfwSetWindowSizeCallback( reshape );
|
||||
glfwSetKeyCallback( key );
|
||||
|
||||
// Main loop
|
||||
while( running )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user