diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-05-16 17:33:52 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-05-16 17:33:52 +0000 |
commit | e4e314d67ac1327aecad7bc2934921eec62050c8 (patch) | |
tree | a2b9b222d72dff45da774fce6d8911ab49b57571 /src/gui/gui.cpp | |
parent | 18ce80c0ab33d39975ed996653942bd2a7614dc9 (diff) | |
download | mana-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/gui/gui.cpp')
-rw-r--r-- | src/gui/gui.cpp | 11 |
1 files changed, 9 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; } |