From cb11b7ca6f06195d361c74b8db71166f1a716047 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Sun, 8 Mar 2015 14:28:42 +0100 Subject: [PATCH] Added live resizing to splitview example. Fixes #424. --- examples/splitview.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/examples/splitview.c b/examples/splitview.c index 30b093b1..1ffcda67 100644 --- a/examples/splitview.c +++ b/examples/splitview.c @@ -371,7 +371,9 @@ static void framebufferSizeFun(GLFWwindow* window, int w, int h) 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 if (do_redraw) - { - // Draw all views - drawAllViews(); - - // Swap buffers - glfwSwapBuffers(window); - - do_redraw = 0; - } + windowRefreshFun(window); // Wait for new events glfwWaitEvents();