Skip to content

Instantly share code, notes, and snippets.

@keithpitt
Created August 4, 2013 11:10
Show Gist options
  • Save keithpitt/6150059 to your computer and use it in GitHub Desktop.
Save keithpitt/6150059 to your computer and use it in GitHub Desktop.
window = glfwCreateWindow(1024, 768, "Test", NULL, NULL);
glfwMakeContextCurrent(window);
glfwSwapInterval(1);
while(1) {
if (glfwGetKey(window, GLFW_KEY_F)) {
glfwDestroyWindow(window);
window = NULL;
GLFWwindow * newWindow;
if (fullscreen) {
newWindow = glfwCreateWindow(1024, 768, "Test", NULL, NULL);
fullscreen = false;
} else {
newWindow = glfwCreateWindow(1024, 768, "Test", glfwGetPrimaryMonitor(), NULL);
fullscreen = true;
}
glfwMakeContextCurrent(newWindow);
glfwSwapInterval(1);
}
// Swap buffers
glfwSwapBuffers(window);
glfwPollEvents();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment