mirror of
https://github.com/glfw/glfw.git
synced 2026-02-17 21:12:34 +01:00
Removed implicit glfwMakeCurrentContext.
Implicitly making the context current makes sense in a single-window API but less sense in a multi-window one.
This commit is contained in:
@@ -589,11 +589,13 @@ int main( void )
|
||||
exit( EXIT_FAILURE );
|
||||
}
|
||||
|
||||
glfwMakeContextCurrent(window);
|
||||
glfwSwapInterval( 1 );
|
||||
|
||||
glfwGetWindowSize(window, &width, &height);
|
||||
reshape(window, width, height);
|
||||
|
||||
glfwSetInputMode( window, GLFW_STICKY_KEYS, GL_TRUE );
|
||||
glfwSwapInterval( 1 );
|
||||
glfwSetTime( 0.0 );
|
||||
|
||||
init();
|
||||
|
||||
@@ -353,11 +353,13 @@ int main(int argc, char *argv[])
|
||||
exit( EXIT_FAILURE );
|
||||
}
|
||||
|
||||
glfwMakeContextCurrent(window);
|
||||
glfwSwapInterval( 1 );
|
||||
|
||||
glfwGetWindowSize(window, &width, &height);
|
||||
reshape(window, width, height);
|
||||
|
||||
glfwSetInputMode( window, GLFW_KEY_REPEAT, GL_TRUE );
|
||||
glfwSwapInterval( 1 );
|
||||
|
||||
// Parse command-line options
|
||||
init(argc, argv);
|
||||
|
||||
@@ -597,10 +597,12 @@ int main(int argc, char** argv)
|
||||
free(fragment_shader_src);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
/* Register events callback */
|
||||
glfwSetWindowCloseCallback(window_close_callback);
|
||||
glfwSetKeyCallback(key_callback);
|
||||
/* Register events callback */
|
||||
|
||||
glfwMakeContextCurrent(window);
|
||||
if (GL_TRUE != init_opengl())
|
||||
{
|
||||
fprintf(stderr, "ERROR: unable to resolve OpenGL function pointers\n");
|
||||
|
||||
@@ -467,12 +467,13 @@ int main(void)
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
// Enable vsync
|
||||
glfwMakeContextCurrent(window);
|
||||
glfwSwapInterval(1);
|
||||
|
||||
glfwGetWindowSize(window, &width, &height);
|
||||
windowSizeFun(window, width, height);
|
||||
|
||||
// Enable vsync
|
||||
glfwSwapInterval(1);
|
||||
|
||||
// Enable sticky keys
|
||||
glfwSetInputMode(window, GLFW_STICKY_KEYS, GL_TRUE);
|
||||
|
||||
|
||||
@@ -30,12 +30,13 @@ int main(void)
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
// Enable vertical sync (on cards that support it)
|
||||
glfwMakeContextCurrent(window);
|
||||
glfwSwapInterval(1);
|
||||
|
||||
// Ensure we can capture the escape key being pressed below
|
||||
glfwSetInputMode(window, GLFW_STICKY_KEYS, GL_TRUE);
|
||||
|
||||
// Enable vertical sync (on cards that support it)
|
||||
glfwSwapInterval(1);
|
||||
|
||||
for (;;)
|
||||
{
|
||||
double t = glfwGetTime();
|
||||
|
||||
@@ -413,11 +413,12 @@ int main(int argc, char* argv[])
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
glfwMakeContextCurrent(window);
|
||||
glfwSwapInterval(1);
|
||||
|
||||
glfwGetWindowSize(window, &width, &height);
|
||||
window_size_callback(window, width, height);
|
||||
|
||||
glfwSwapInterval(1);
|
||||
|
||||
glfwSetInputMode(window, GLFW_KEY_REPEAT, GL_TRUE);
|
||||
|
||||
// Initialize OpenGL
|
||||
|
||||
Reference in New Issue
Block a user