Change gameShouldTerminate
This commit is contained in:
@@ -14,6 +14,7 @@ Window::Window() {
|
||||
// Create OpenGL context
|
||||
glfwMakeContextCurrent(window);
|
||||
|
||||
// Initialize GLAD
|
||||
if (!gladLoadGLLoader((GLADloadproc)glfwGetProcAddress)) {
|
||||
std::cout << "Failed to initialize GLAD" << std::endl;
|
||||
exit(-1);
|
||||
@@ -21,6 +22,7 @@ Window::Window() {
|
||||
|
||||
glViewport(0, 0, width, height);
|
||||
|
||||
// Tell GLFW which function to call when window is resized
|
||||
glfwSetFramebufferSizeCallback(window, framebuffer_size_callback);
|
||||
|
||||
}
|
||||
@@ -29,6 +31,7 @@ Window::~Window() {
|
||||
glfwDestroyWindow(window);
|
||||
}
|
||||
|
||||
// This function is called when the window gets resized
|
||||
void Window::framebuffer_size_callback(GLFWwindow* window, int width, int height) {
|
||||
(void)window;
|
||||
glViewport(0, 0, width, height);
|
||||
|
||||
Reference in New Issue
Block a user