Removed calling of callbacks from setters.

This commit is contained in:
Camilla Berglund
2012-08-07 12:14:58 +02:00
parent c55f84ef3f
commit 8ed66ea4d5
7 changed files with 47 additions and 48 deletions

View File

@@ -456,6 +456,7 @@ static int windowCloseFun(GLFWwindow window)
int main(void)
{
GLFWwindow window;
int width, height;
// Initialise GLFW
if (!glfwInit())
@@ -464,6 +465,13 @@ int main(void)
exit(EXIT_FAILURE);
}
// Set callback functions
glfwSetWindowCloseCallback(windowCloseFun);
glfwSetWindowSizeCallback(windowSizeFun);
glfwSetWindowRefreshCallback(windowRefreshFun);
glfwSetCursorPosCallback(cursorPosFun);
glfwSetMouseButtonCallback(mouseButtonFun);
glfwWindowHint(GLFW_DEPTH_BITS, 16);
// Open OpenGL window
@@ -474,6 +482,9 @@ int main(void)
exit(EXIT_FAILURE);
}
glfwGetWindowSize(window, &width, &height);
windowSizeFun(window, width, height);
// Enable vsync
glfwSwapInterval(1);
@@ -483,13 +494,6 @@ int main(void)
// Enable mouse cursor (only needed for fullscreen mode)
glfwSetInputMode(window, GLFW_CURSOR_MODE, GLFW_CURSOR_NORMAL);
// Set callback functions
glfwSetWindowCloseCallback(windowCloseFun);
glfwSetWindowSizeCallback(windowSizeFun);
glfwSetWindowRefreshCallback(windowRefreshFun);
glfwSetCursorPosCallback(cursorPosFun);
glfwSetMouseButtonCallback(mouseButtonFun);
// Main loop
do
{