diff options
-rw-r--r-- | src/graphicsvertexes.cpp | 8 | ||||
-rw-r--r-- | src/graphicsvertexes.h | 17 | ||||
-rw-r--r-- | src/opengl1graphics.cpp | 5 |
3 files changed, 21 insertions, 9 deletions
diff --git a/src/graphicsvertexes.cpp b/src/graphicsvertexes.cpp index 1170d55fd..6beb41a88 100644 --- a/src/graphicsvertexes.cpp +++ b/src/graphicsvertexes.cpp @@ -29,7 +29,6 @@ int GraphicsVertexes::mUseOpenGL = 0; const unsigned int vertexBufSize = 500; #endif - SDLGraphicsVertexes::SDLGraphicsVertexes() { @@ -40,7 +39,7 @@ SDLGraphicsVertexes::~SDLGraphicsVertexes() delete_all(mList); } - +#ifdef USE_OPENGL OpenGLGraphicsVertexes::OpenGLGraphicsVertexes() : mFloatTexArray(0), mIntTexArray(0), @@ -94,6 +93,7 @@ void OpenGLGraphicsVertexes::switchVp(int n) { mVp.push_back(n); } +#endif GraphicsVertexes::GraphicsVertexes() : mX(0), mY(0), @@ -116,14 +116,18 @@ void GraphicsVertexes::init(int x, int y, int w, int h) for (int f = 0; f < 10; f ++) { sdl[mPtr].mList.clear(); +#ifdef USE_OPENGL ogl[mPtr].init(); +#endif } } +#ifdef USE_OPENGL void GraphicsVertexes::setLoadAsOpenGL(int useOpenGL) { mUseOpenGL = useOpenGL; } +#endif void GraphicsVertexes::pushSDL(SDL_Rect r1, SDL_Rect r2) { diff --git a/src/graphicsvertexes.h b/src/graphicsvertexes.h index 1efb74f01..2ab54197d 100644 --- a/src/graphicsvertexes.h +++ b/src/graphicsvertexes.h @@ -55,7 +55,7 @@ class SDLGraphicsVertexes std::list<DoubleRect*> mList; }; - +#ifdef USE_OPENGL class OpenGL1GraphicsVertexes { }; @@ -73,10 +73,6 @@ class OpenGLGraphicsVertexes GLint *switchIntTexArray(); - void init(); - - void clear(); - std::vector<GLfloat*> &getFloatTexPool() { return mFloatTexPool; } @@ -91,6 +87,10 @@ class OpenGLGraphicsVertexes std::vector<int> &getVp() { return mVp; } + void init(); + + void clear(); + private: GLfloat *mFloatTexArray; GLint *mIntTexArray; @@ -100,6 +100,7 @@ class OpenGLGraphicsVertexes std::vector<GLint*> mIntTexPool; std::vector<int> mVp; }; +#endif class GraphicsVertexes { @@ -112,9 +113,11 @@ class GraphicsVertexes SDLGraphicsVertexes sdl[5]; +#ifdef USE_OPENGL OpenGL1GraphicsVertexes ogl1[5]; OpenGLGraphicsVertexes ogl[5]; +#endif void init(int x, int y, int w, int h); @@ -130,8 +133,10 @@ class GraphicsVertexes void setPtr(int num) { mPtr = num; } +#ifdef USE_OPENGL OpenGLGraphicsVertexes* getOGL() { return &ogl[mPtr]; } +#endif int getX() { return mX; } @@ -149,7 +154,9 @@ class GraphicsVertexes int mPtr; private: +#ifdef USE_OPENGL static int mUseOpenGL; +#endif }; #endif // GRAPHICSVERTEXES_H diff --git a/src/opengl1graphics.cpp b/src/opengl1graphics.cpp index 4a1322e6d..30d54e754 100644 --- a/src/opengl1graphics.cpp +++ b/src/opengl1graphics.cpp @@ -20,6 +20,9 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ +#include "main.h" + +#ifdef USE_OPENGL #include "opengl1graphics.h" #include "graphicsvertexes.h" @@ -27,8 +30,6 @@ #include "resources/image.h" -#ifdef USE_OPENGL - #ifdef __APPLE__ #include <OpenGL/OpenGL.h> #endif |