diff options
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; } |