diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-02-14 15:13:54 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-02-14 15:13:54 +0000 |
commit | 4f6c1dad35e575588b73524692d973dec06447c3 (patch) | |
tree | d052c3c7db66450888af132ac9dcefb7c28b58a6 /src/gui/gui.cpp | |
parent | ebccde5d779f25584386ddc0c4bdc6331877bcc6 (diff) | |
download | mana-4f6c1dad35e575588b73524692d973dec06447c3.tar.gz mana-4f6c1dad35e575588b73524692d973dec06447c3.tar.bz2 mana-4f6c1dad35e575588b73524692d973dec06447c3.tar.xz mana-4f6c1dad35e575588b73524692d973dec06447c3.zip |
Support for drawing using OpenGL. Don't expect it to be fast yet though.
Diffstat (limited to 'src/gui/gui.cpp')
-rw-r--r-- | src/gui/gui.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index b64f6a98..6cc05910 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -41,7 +41,12 @@ Gui::Gui(Graphics *graphics): guiInput = new gcn::SDLInput(); // Set image loader +#ifndef USE_OPENGL imageLoader = new gcn::SDLImageLoader(); +#else + hostImageLoader = new gcn::SDLImageLoader(); + imageLoader = new gcn::OpenGLImageLoader(hostImageLoader); +#endif gcn::Image::setImageLoader(imageLoader); // Initialize top GUI widget @@ -67,6 +72,9 @@ Gui::~Gui() delete guiFont; delete guiTop; delete imageLoader; +#ifdef USE_OPENGL + delete hostImageLoader; +#endif delete guiInput; delete focusHandler; } @@ -148,16 +156,13 @@ void Gui::logic() void Gui::draw() { - guiGraphics->_beginDraw(); + //guiGraphics->_beginDraw(); guiGraphics->pushClipArea(guiTop->getDimension()); guiTop->draw(guiGraphics); guiGraphics->popClipArea(); - // Draw the mouse - //draw_sprite(buffer, mouse_sprite, mouse_x, mouse_y); - - guiGraphics->_endDraw(); + //guiGraphics->_endDraw(); } void Gui::focusNone() |