TheCherno / Sparky

Cross-Platform High Performance 2D/3D game engine for people like me who like to write code.
Apache License 2.0
1.1k stars 222 forks source link

Change GLFW window resize callback #11

Closed CaioIcy closed 9 years ago

CaioIcy commented 9 years ago

Hello,

inside Window::init() you call glfwSetWindowSizeCallback to use glViewport in the callback.

In GLFW's documentation they say why you shouldn't use that function:

"Do not pass the window size to glViewport or other pixel-based OpenGL calls. The window size is in screen coordinates, not pixels. Use the framebuffer size, which is in pixels, for pixel-based calls."

So you should change glfwSetWindowSizeCallback to glfwSetFramebufferSizeCallback, which will be correct.

CaioIcy commented 9 years ago

I just saw that this has already been addressed, but by a pull request. I'll leave this issue here, since it explains why the change should be made.

TheCherno commented 9 years ago

I'll change it to this in the upcoming maintenance episode (Ep. 20).