|
|
@ -371,7 +371,9 @@ static void framebufferSizeFun(GLFWwindow* window, int w, int h) |
|
|
|
|
|
|
|
|
|
|
|
static void windowRefreshFun(GLFWwindow* window) |
|
|
|
static void windowRefreshFun(GLFWwindow* window) |
|
|
|
{ |
|
|
|
{ |
|
|
|
do_redraw = 1; |
|
|
|
drawAllViews(); |
|
|
|
|
|
|
|
glfwSwapBuffers(window); |
|
|
|
|
|
|
|
do_redraw = 0; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -485,15 +487,7 @@ int main(void) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// Only redraw if we need to
|
|
|
|
// Only redraw if we need to
|
|
|
|
if (do_redraw) |
|
|
|
if (do_redraw) |
|
|
|
{ |
|
|
|
windowRefreshFun(window); |
|
|
|
// Draw all views
|
|
|
|
|
|
|
|
drawAllViews(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Swap buffers
|
|
|
|
|
|
|
|
glfwSwapBuffers(window); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
do_redraw = 0; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Wait for new events
|
|
|
|
// Wait for new events
|
|
|
|
glfwWaitEvents(); |
|
|
|
glfwWaitEvents(); |
|
|
|