diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2008-11-01 10:52:40 +0000 |
---|---|---|
committer | Ira Rice <irarice@gmail.com> | 2008-12-02 22:49:35 -0700 |
commit | ff89a2184651b676f0e835ec7991a100361465d1 (patch) | |
tree | 985b4e0579d582106f2055bd261b4706ab522a3f /src/openglgraphics.cpp | |
parent | 7882d3dfcac6b2894d33947d4dca5df375712646 (diff) | |
download | mana-ff89a2184651b676f0e835ec7991a100361465d1.tar.gz mana-ff89a2184651b676f0e835ec7991a100361465d1.tar.bz2 mana-ff89a2184651b676f0e835ec7991a100361465d1.tar.xz mana-ff89a2184651b676f0e835ec7991a100361465d1.zip |
Made an option around the syncing, but no way to change it for now.
Diffstat (limited to 'src/openglgraphics.cpp')
-rw-r--r-- | src/openglgraphics.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/openglgraphics.cpp b/src/openglgraphics.cpp index eeedcdf1..b3a8db4b 100644 --- a/src/openglgraphics.cpp +++ b/src/openglgraphics.cpp @@ -43,7 +43,8 @@ #endif OpenGLGraphics::OpenGLGraphics(): - mAlpha(false), mTexture(false), mColorAlpha(false) + mAlpha(false), mTexture(false), mColorAlpha(false), + mSync(false) { } @@ -51,6 +52,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", @@ -74,6 +80,10 @@ bool OpenGLGraphics::setVideoMode(int w, int h, int bpp, bool fs, bool hwaccel) #ifdef __APPLE__ // long VBL = 1; // CGLSetParameter(CGLGetCurrentContext(), kCGLCPSwapInterval, &VBL); + if (mSync) { + const GLint VBL = 1; + CGLSetParameter(CGLGetCurrentContext(), kCGLCPSwapInterval, &VBL); + } #endif // Setup OpenGL |