Separated window and framebuffer sizes.

This commit is contained in:
Camilla Berglund
2013-06-03 12:51:57 +02:00
parent 89588a4508
commit 3498163da1
26 changed files with 197 additions and 58 deletions

View File

@@ -354,10 +354,10 @@ static void drawAllViews(void)
//========================================================================
// Window size callback function
// Framebuffer size callback function
//========================================================================
static void windowSizeFun(GLFWwindow* window, int w, int h)
static void framebufferSizeFun(GLFWwindow* window, int w, int h)
{
width = w;
height = h > 0 ? h : 1;
@@ -467,7 +467,7 @@ int main(void)
}
// Set callback functions
glfwSetWindowSizeCallback(window, windowSizeFun);
glfwSetFramebufferSizeCallback(window, framebufferSizeFun);
glfwSetWindowRefreshCallback(window, windowRefreshFun);
glfwSetCursorPosCallback(window, cursorPosFun);
glfwSetMouseButtonCallback(window, mouseButtonFun);
@@ -477,8 +477,8 @@ int main(void)
glfwMakeContextCurrent(window);
glfwSwapInterval(1);
glfwGetWindowSize(window, &width, &height);
windowSizeFun(window, width, height);
glfwGetFramebufferSize(window, &width, &height);
framebufferSizeFun(window, width, height);
// Main loop
for (;;)