summaryrefslogtreecommitdiff
path: root/src/graphics.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2005-05-16 17:33:52 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2005-05-16 17:33:52 +0000
commite4e314d67ac1327aecad7bc2934921eec62050c8 (patch)
treea2b9b222d72dff45da774fce6d8911ab49b57571 /src/graphics.cpp
parent18ce80c0ab33d39975ed996653942bd2a7614dc9 (diff)
downloadmana-e4e314d67ac1327aecad7bc2934921eec62050c8.tar.gz
mana-e4e314d67ac1327aecad7bc2934921eec62050c8.tar.bz2
mana-e4e314d67ac1327aecad7bc2934921eec62050c8.tar.xz
mana-e4e314d67ac1327aecad7bc2934921eec62050c8.zip
Leave out OpenGL completely when not enabled.
Diffstat (limited to 'src/graphics.cpp')
-rw-r--r--src/graphics.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/graphics.cpp b/src/graphics.cpp
index 94c23704..4e43b4b5 100644
--- a/src/graphics.cpp
+++ b/src/graphics.cpp
@@ -32,6 +32,7 @@ SDL_Surface *screen;
Graphics::Graphics():
mouseCursor(NULL)
{
+#ifdef USE_OPENGL
if (useOpenGL) {
// Setup OpenGL
glViewport(0, 0, 800, 600);
@@ -41,6 +42,7 @@ Graphics::Graphics():
logger->log("Using OpenGL %s double buffering.",
(gotDoubleBuffer ? "with" : "without"));
}
+#endif
#ifdef USE_OPENGL
setTargetPlane(800, 600);
@@ -139,6 +141,7 @@ void Graphics::updateScreen()
mouseCursor->draw(screen, mouseX - 5, mouseY - 2);
}
+#ifdef USE_OPENGL
if (useOpenGL) {
glFlush();
glFinish();
@@ -148,6 +151,9 @@ void Graphics::updateScreen()
else {
SDL_Flip(screen);
}
+#else
+ SDL_Flip(screen);
+#endif
// Decrement frame counter when using framerate limiting
if (framesToDraw > 1) framesToDraw--;