From e4e314d67ac1327aecad7bc2934921eec62050c8 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Mon, 16 May 2005 17:33:52 +0000 Subject: Leave out OpenGL completely when not enabled. --- src/gui/gui.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/gui/gui.cpp') 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; } -- cgit v1.2.3-70-g09d2