Last active
May 11, 2016 11:59
-
-
Save stuartwakefield/409f0bcf254ddf8ec36cd197926a196a to your computer and use it in GitHub Desktop.
Sets the GL viewport based correctly for higher DPI monitors
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class GLFWGLViewport { | |
public void apply(GLWindow window) { | |
IntBuffer wbuf = BufferUtils.createIntBuffer(1); | |
IntBuffer hbuf = BufferUtils.createIntBuffer(1); | |
GLFW.glfwGetFramebufferSize(window.getId(), wbuf, hbuf); | |
int w = wbuf.get(0); | |
int h = hbuf.get(0); | |
GL11.glViewport(0, 0, w, h); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment