summaryrefslogtreecommitdiff
path: root/src/graphics.cpp
diff options
context:
space:
mode:
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--;