commit e7f163b3ced3d5db960a8b8326c6b99d019c63ae
parent fa9bd3fe39b86a75cda8c4a229f2a98493809d38
Author: Brian Swetland <swetland@frotz.net>
Date: Thu, 17 Jan 2013 22:10:57 -0800
Don't call SDL_GL_SwapBuffers() when GL double buffering is disabled
This makes some drivers asplode (like those on my Thinkpad X201)
Diffstat:
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/sdlglue.c b/sdlglue.c
@@ -161,11 +161,16 @@ int main(int argc, char **argv) {
if (scene_draw(&c))
return -1;
+ if (vsync) {
#if WITH_SDL2
- SDL_GL_SwapWindow(w);
+ SDL_GL_SwapWindow(w);
#else
- SDL_GL_SwapBuffers();
+ SDL_GL_SwapBuffers();
#endif
+ } else {
+ glFlush();
+ }
+
t1 = time(0);
count++;
if (t0 != t1) {