summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/gui.cpp11
-rw-r--r--src/gui/gui.h2
2 files changed, 11 insertions, 2 deletions
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp
index 5b527904..ab818555 100644
--- a/src/gui/gui.cpp
+++ b/src/gui/gui.cpp
@@ -34,8 +34,7 @@ Graphics *guiGraphics; // Graphics driver
gcn::SDLInput *guiInput; // GUI input
WindowContainer *guiTop; // The top container
-Gui::Gui(Graphics *graphics):
- hostImageLoader(NULL)
+Gui::Gui(Graphics *graphics)
{
// Set graphics
guiGraphics = graphics;
@@ -46,13 +45,19 @@ Gui::Gui(Graphics *graphics):
setInput(guiInput);
// Set image loader
+#ifdef USE_OPENGL
if (useOpenGL) {
hostImageLoader = new gcn::SDLImageLoader();
imageLoader = new gcn::OpenGLImageLoader(hostImageLoader);
}
else {
+ hostImageLoader = NULL;
imageLoader = new gcn::SDLImageLoader();
}
+#else
+ imageLoader = new gcn::SDLImageLoader();
+#endif
+
gcn::Image::setImageLoader(imageLoader);
// Initialize top GUI widget
@@ -84,9 +89,11 @@ Gui::~Gui()
delete guiFont;
delete guiTop;
delete imageLoader;
+#ifdef USE_OPENGL
if (hostImageLoader) {
delete hostImageLoader;
}
+#endif
delete guiInput;
}
diff --git a/src/gui/gui.h b/src/gui/gui.h
index ff1f4889..35b7e21f 100644
--- a/src/gui/gui.h
+++ b/src/gui/gui.h
@@ -73,7 +73,9 @@ class Gui : public gcn::Gui, public gcn::MouseListener
private:
gcn::Gui *gui; /**< The GUI system */
+#ifdef USE_OPENGL
gcn::ImageLoader *hostImageLoader; /**< For loading images in GL */
+#endif
gcn::ImageLoader *imageLoader; /**< For loading images */
gcn::ImageFont *guiFont; /**< The global GUI font */