summaryrefslogtreecommitdiff
path: root/src/graphics.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2005-07-27 21:55:20 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2005-07-27 21:55:20 +0000
commitd15d76976b6e57a9f421ab034c6f841051b962f3 (patch)
treeab0c37c90af9f76158b96f195c05be9b221e9f42 /src/graphics.cpp
parentaa362286c725e17ec88aa46f8f6af9ca90d744b3 (diff)
downloadmana-client-d15d76976b6e57a9f421ab034c6f841051b962f3.tar.gz
mana-client-d15d76976b6e57a9f421ab034c6f841051b962f3.tar.bz2
mana-client-d15d76976b6e57a9f421ab034c6f841051b962f3.tar.xz
mana-client-d15d76976b6e57a9f421ab034c6f841051b962f3.zip
Committing merging opengl and sdl part 3 by Andrej
Diffstat (limited to 'src/graphics.cpp')
-rw-r--r--src/graphics.cpp40
1 files changed, 25 insertions, 15 deletions
diff --git a/src/graphics.cpp b/src/graphics.cpp
index 8fc60abb..93448c7c 100644
--- a/src/graphics.cpp
+++ b/src/graphics.cpp
@@ -50,35 +50,41 @@ Graphics::Graphics(SDL_Surface *screen):
}
// Initialize for drawing
- if (useOpenGL) {
- gcn::OpenGLGraphics::_beginDraw() ;
+ if (!useOpenGL) {
+ gcn::SDLGraphics::_beginDraw();
}
+#ifdef USE_OPENGL
else {
- gcn::SDLGraphics::_beginDraw();
+ gcn::OpenGLGraphics::_beginDraw();
}
+#endif
//_beginDraw();
}
Graphics::~Graphics()
{
// Deinitialize for drawing
- if (useOpenGL) {
- gcn::OpenGLGraphics::_endDraw() ;
+ if (!useOpenGL) {
+ gcn::SDLGraphics::_endDraw();
}
+#ifdef USE_OPENGL
else {
- gcn::SDLGraphics::_endDraw();
+ gcn::OpenGLGraphics::_endDraw();
}
+#endif
//_endDraw();
}
void Graphics::setFont(gcn::ImageFont *font)
{
- if (useOpenGL) {
- gcn::OpenGLGraphics::setFont(font);
+ if (!useOpenGL) {
+ gcn::SDLGraphics::setFont(font);
}
+#ifdef USE_OPENGL
else {
- gcn::SDLGraphics::setFont(font);
+ gcn::OpenGLGraphics::setFont(font);
}
+#endif
}
void Graphics::drawText(const std::string &text,
@@ -86,22 +92,26 @@ void Graphics::drawText(const std::string &text,
int y,
unsigned int alignment)
{
- if (useOpenGL) {
- gcn::OpenGLGraphics::drawText(text, x, y, alignment);
+ if (!useOpenGL) {
+ gcn::SDLGraphics::drawText(text, x, y, alignment);
}
+#ifdef USE_OPENGL
else {
- gcn::SDLGraphics::drawText(text, x, y, alignment);
+ gcn::OpenGLGraphics::drawText(text, x, y, alignment);
}
+#endif
}
void Graphics::setColor(gcn::Color color)
{
- if (useOpenGL) {
- gcn::OpenGLGraphics::setColor(color);
+ if (!useOpenGL) {
+ gcn::SDLGraphics::setColor(color);
}
+#ifdef USE_OPENGL
else {
- gcn::SDLGraphics::setColor(color);
+ gcn::OpenGLGraphics::setColor(color);
}
+#endif
}
int Graphics::getWidth()