summaryrefslogtreecommitdiff
path: root/src/graphics.cpp
diff options
context:
space:
mode:
authorBjörn Steinbrink <B.Steinbrink@gmx.de>2005-08-10 07:46:41 +0000
committerBjörn Steinbrink <B.Steinbrink@gmx.de>2005-08-10 07:46:41 +0000
commit7bbe721a23b9caba7a67ac806be10aa536f7f46d (patch)
treed87383830d132ca08b472abed69b20f3f3eee58a /src/graphics.cpp
parent4d338e801f8b1175585de6b5e7b8b2ca331b682f (diff)
downloadmana-7bbe721a23b9caba7a67ac806be10aa536f7f46d.tar.gz
mana-7bbe721a23b9caba7a67ac806be10aa536f7f46d.tar.bz2
mana-7bbe721a23b9caba7a67ac806be10aa536f7f46d.tar.xz
mana-7bbe721a23b9caba7a67ac806be10aa536f7f46d.zip
Moved knowledge about whether we use OpenGL into the Graphics class. Added helper function for being creation to reduce code duplication. Some code simplifications.
Diffstat (limited to 'src/graphics.cpp')
-rw-r--r--src/graphics.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/graphics.cpp b/src/graphics.cpp
index 0ee2371d..21797f55 100644
--- a/src/graphics.cpp
+++ b/src/graphics.cpp
@@ -192,6 +192,42 @@ void Graphics::setColor(gcn::Color color)
#endif
}
+void Graphics::popClipArea()
+{
+ if (!useOpenGL) {
+ gcn::SDLGraphics::popClipArea();
+ }
+#ifdef USE_OPENGL
+ else {
+ gcn::OpenGLGraphics::popClipArea();
+ }
+#endif
+}
+
+bool Graphics::pushClipArea(gcn::Rectangle area)
+{
+ if (!useOpenGL) {
+ return gcn::SDLGraphics::pushClipArea(area);
+ }
+#ifdef USE_OPENGL
+ else {
+ return gcn::OpenGLGraphics::pushClipArea(area);
+ }
+#endif
+}
+
+void Graphics::fillRectangle(const gcn::Rectangle &rectangle)
+{
+ if (!useOpenGL) {
+ gcn::SDLGraphics::fillRectangle(rectangle);
+ }
+#ifdef USE_OPENGL
+ else {
+ gcn::OpenGLGraphics::fillRectangle(rectangle);
+ }
+#endif
+}
+
int Graphics::getWidth()
{
return mScreen->w;