LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: PrudiiArca on June 27, 2016, 17:58:20

Title: glfwGetWindowSize vs glfwFramebufferSize in LWJGL 3.0.0
Post by: PrudiiArca on June 27, 2016, 17:58:20
Hey guys,
Do you know, whether GLFW's getWindowSize and getFramebufferSize normally return the same values? I am using the following code to check both the window size and the framebuffer size but think they should be different...

glfwGetWindowSize(ID, widthBuffer, heightBuffer);
int newWidth = widthBuffer.get(0);
int newHeight = heightBuffer.get(0);

glfwGetFramebufferSize(ID, widthBuffer, heightBuffer);
int newCanvasWidth = widthBuffer.get(0);
int newCanvasHeight = heightBuffer.get(0);

System.out.println(newWidth + " " + newHeight + " - " + newCanvasWidth + " " + newCanvasHeight);

The result is "900 600 - 900 600". It seems to me that the framebuffer size is set to the window size instead of giving the right size...
The width and height buffers are properly created IntBuffers. I tried it with arrays too.
Title: Re: glfwGetWindowSize vs glfwFramebufferSize in LWJGL 3.0.0
Post by: Kai on June 27, 2016, 18:35:32
On non-HiDPI displays both are the same value. In the non-HiDPI case both give the dimensions in pixels of the client rect area of the window. Note that glfwGetWindowSize returns the dimensions of the client area of the window and not the whole window.
On HiDPI displays, you'll see that glfwGetFramebufferSize returns about 2x the size of the window size in each dimension.