summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/graphics.cpp14
-rw-r--r--src/graphics.h10
-rw-r--r--src/opengl1graphics.cpp11
-rw-r--r--src/opengl1graphics.h10
-rw-r--r--src/openglgraphics.cpp11
-rw-r--r--src/openglgraphics.h10
6 files changed, 25 insertions, 41 deletions
diff --git a/src/graphics.cpp b/src/graphics.cpp
index b8d34aad4..d94963f06 100644
--- a/src/graphics.cpp
+++ b/src/graphics.cpp
@@ -34,6 +34,12 @@
#include <guichan/sdl/sdlpixel.hpp>
+#ifdef USE_OPENGL
+#ifdef __APPLE__
+#include <OpenGL/OpenGL.h>
+#endif
+#endif
+
#include <SDL_gfxBlitFunc.h>
#include "debug.h"
@@ -68,7 +74,8 @@ Graphics::Graphics() :
mOldPixel(0),
mOldAlpha(0),
mName("Software"),
- mStartFreeMem(0)
+ mStartFreeMem(0),
+ mSync(false)
{
mRect.x = 0;
mRect.y = 0;
@@ -81,6 +88,11 @@ Graphics::~Graphics()
_endDraw();
}
+void Graphics::setSync(bool sync)
+{
+ mSync = sync;
+}
+
void Graphics::setMainFlags(int w, int h, int bpp, bool fs,
bool hwaccel, bool resize, bool noFrame)
{
diff --git a/src/graphics.h b/src/graphics.h
index 5c3111e0a..96e5555b7 100644
--- a/src/graphics.h
+++ b/src/graphics.h
@@ -94,6 +94,15 @@ class Graphics : public gcn::SDLGraphics
virtual ~Graphics();
/**
+ * Sets whether vertical refresh syncing is enabled. Takes effect after
+ * the next call to setVideoMode(). Only implemented on MacOS for now.
+ */
+ void setSync(bool sync);
+
+ bool getSync() const
+ { return mSync; }
+
+ /**
* Try to create a window with the given settings.
*/
virtual bool setVideoMode(int w, int h, int bpp, bool fs,
@@ -328,6 +337,7 @@ class Graphics : public gcn::SDLGraphics
int mOldAlpha;
std::string mName;
int mStartFreeMem;
+ bool mSync;
};
extern Graphics *mainGraphics;
diff --git a/src/opengl1graphics.cpp b/src/opengl1graphics.cpp
index dd39adb8b..dbd983fb5 100644
--- a/src/opengl1graphics.cpp
+++ b/src/opengl1graphics.cpp
@@ -31,10 +31,6 @@
#include "resources/image.h"
-#ifdef __APPLE__
-#include <OpenGL/OpenGL.h>
-#endif
-
#include <SDL.h>
#include "debug.h"
@@ -47,7 +43,7 @@
GLuint OpenGL1Graphics::mLastImage = 0;
OpenGL1Graphics::OpenGL1Graphics():
- mAlpha(false), mTexture(false), mColorAlpha(false), mSync(false),
+ mAlpha(false), mTexture(false), mColorAlpha(false),
mFboId(0), mTextureId(0), mRboId(0)
{
mOpenGL = 2;
@@ -58,11 +54,6 @@ OpenGL1Graphics::~OpenGL1Graphics()
{
}
-void OpenGL1Graphics::setSync(bool sync)
-{
- mSync = sync;
-}
-
bool OpenGL1Graphics::setVideoMode(int w, int h, int bpp, bool fs,
bool hwaccel, bool resize, bool noFrame)
{
diff --git a/src/opengl1graphics.h b/src/opengl1graphics.h
index 113b4b8a7..a9fc95722 100644
--- a/src/opengl1graphics.h
+++ b/src/opengl1graphics.h
@@ -41,15 +41,6 @@ class OpenGL1Graphics : public Graphics
~OpenGL1Graphics();
- /**
- * Sets whether vertical refresh syncing is enabled. Takes effect after
- * the next call to setVideoMode(). Only implemented on MacOS for now.
- */
- void setSync(bool sync);
-
- bool getSync() const
- { return mSync; }
-
bool setVideoMode(int w, int h, int bpp, bool fs,
bool hwaccel, bool resize, bool noFrame);
@@ -141,7 +132,6 @@ class OpenGL1Graphics : public Graphics
private:
bool mAlpha, mTexture;
bool mColorAlpha;
- bool mSync;
GLuint mFboId;
GLuint mTextureId;
GLuint mRboId;
diff --git a/src/openglgraphics.cpp b/src/openglgraphics.cpp
index 4f800bf9b..bcadb8c67 100644
--- a/src/openglgraphics.cpp
+++ b/src/openglgraphics.cpp
@@ -33,10 +33,6 @@
#include "utils/stringutils.h"
-#ifdef __APPLE__
-#include <OpenGL/OpenGL.h>
-#endif
-
#include <SDL.h>
#include "debug.h"
@@ -51,7 +47,7 @@ const unsigned int vertexBufSize = 500;
GLuint OpenGLGraphics::mLastImage = 0;
OpenGLGraphics::OpenGLGraphics():
- mAlpha(false), mTexture(false), mColorAlpha(false), mSync(false),
+ mAlpha(false), mTexture(false), mColorAlpha(false),
mFboId(0), mTextureId(0), mRboId(0)
{
mOpenGL = 1;
@@ -68,11 +64,6 @@ OpenGLGraphics::~OpenGLGraphics()
delete [] mIntVertArray;
}
-void OpenGLGraphics::setSync(bool sync)
-{
- mSync = sync;
-}
-
bool OpenGLGraphics::setVideoMode(int w, int h, int bpp, bool fs,
bool hwaccel, bool resize, bool noFrame)
{
diff --git a/src/openglgraphics.h b/src/openglgraphics.h
index 8d90ec72a..e088fa4e2 100644
--- a/src/openglgraphics.h
+++ b/src/openglgraphics.h
@@ -43,15 +43,6 @@ class OpenGLGraphics : public Graphics
~OpenGLGraphics();
- /**
- * Sets whether vertical refresh syncing is enabled. Takes effect after
- * the next call to setVideoMode(). Only implemented on MacOS for now.
- */
- void setSync(bool sync);
-
- bool getSync() const
- { return mSync; }
-
bool setVideoMode(int w, int h, int bpp, bool fs,
bool hwaccel, bool resize, bool noFrame);
@@ -167,7 +158,6 @@ class OpenGLGraphics : public Graphics
GLint *mIntVertArray;
bool mAlpha, mTexture;
bool mColorAlpha;
- bool mSync;
GLuint mFboId;
GLuint mTextureId;
GLuint mRboId;