From f4f15045eb4df67364cafb43ec7e4917d35d185f Mon Sep 17 00:00:00 2001 From: vurtun Date: Wed, 23 Sep 2015 16:59:31 +0200 Subject: [PATCH] removed framerate limit in opengl + nanovg demo for window smoother dragging --- demo/nanovg/nanovg.c | 8 -------- demo/opengl/opengl.c | 8 -------- 2 files changed, 16 deletions(-) diff --git a/demo/nanovg/nanovg.c b/demo/nanovg/nanovg.c index 6393b3c..404c177 100644 --- a/demo/nanovg/nanovg.c +++ b/demo/nanovg/nanovg.c @@ -251,8 +251,6 @@ main(int argc, char *argv[]) SDL_Window *win; SDL_GLContext glContext; NVGcontext *vg = NULL; - unsigned int started; - unsigned int dt; /* GUI */ struct demo_gui gui; @@ -298,7 +296,6 @@ main(int argc, char *argv[]) while (gui.running) { /* Input */ SDL_Event evt; - started = SDL_GetTicks(); zr_input_begin(&gui.input); while (SDL_PollEvent(&evt)) { if (evt.type == SDL_WINDOWEVENT) resize(&evt); @@ -323,11 +320,6 @@ main(int argc, char *argv[]) glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); draw(vg, &gui.queue, width, height); SDL_GL_SwapWindow(win); - - /* Timing */ - dt = SDL_GetTicks() - started; - if (dt < DTIME) - SDL_Delay(DTIME - dt); } cleanup: diff --git a/demo/opengl/opengl.c b/demo/opengl/opengl.c index 4f3c8e5..e46b2df 100644 --- a/demo/opengl/opengl.c +++ b/demo/opengl/opengl.c @@ -446,8 +446,6 @@ main(int argc, char *argv[]) SDL_Window *win; SDL_GLContext glContext; int win_width, win_height; - unsigned int started; - unsigned int dt; int width = 0, height = 0; /* GUI */ @@ -491,7 +489,6 @@ main(int argc, char *argv[]) while (gui.running) { /* Input */ SDL_Event evt; - started = SDL_GetTicks(); zr_input_begin(&gui.input); while (SDL_PollEvent(&evt)) { if (evt.type == SDL_WINDOWEVENT) resize(&evt); @@ -518,11 +515,6 @@ main(int argc, char *argv[]) glClearColor(0.4f, 0.4f, 0.4f, 1.0f); device_draw(&device, &gui.queue, width, height); SDL_GL_SwapWindow(win); - - /* Timing */ - dt = SDL_GetTicks() - started; - if (dt < DTIME) - SDL_Delay(DTIME - dt); } cleanup: