diff options
Diffstat (limited to 'src/openglgraphics.cpp')
-rw-r--r-- | src/openglgraphics.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/openglgraphics.cpp b/src/openglgraphics.cpp index b6a4e7d8..67248100 100644 --- a/src/openglgraphics.cpp +++ b/src/openglgraphics.cpp @@ -47,7 +47,8 @@ #include "resources/image.h" OpenGLGraphics::OpenGLGraphics(): - mAlpha(false), mTexture(false), mColorAlpha(false) + mAlpha(false), mTexture(false), mColorAlpha(false), + mSync(false) { } @@ -55,6 +56,11 @@ OpenGLGraphics::~OpenGLGraphics() { } +void OpenGLGraphics::setSync(bool sync) +{ + mSync = sync; +} + bool OpenGLGraphics::setVideoMode(int w, int h, int bpp, bool fs, bool hwaccel) { logger->log("Setting video mode %dx%d %s", @@ -76,8 +82,10 @@ bool OpenGLGraphics::setVideoMode(int w, int h, int bpp, bool fs, bool hwaccel) } #ifdef __APPLE__ - //const GLint VBL = 1; - //CGLSetParameter(CGLGetCurrentContext(), kCGLCPSwapInterval, &VBL); + if (mSync) { + const GLint VBL = 1; + CGLSetParameter(CGLGetCurrentContext(), kCGLCPSwapInterval, &VBL); + } #endif // Setup OpenGL |