diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-05-22 20:13:25 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-05-22 20:13:25 +0300 |
commit | dee232be436909e84a39e9bc3e8949dbaba38e05 (patch) | |
tree | 7906ae43fad0126e4c2c7f78c80f67ff44064ae2 /src | |
parent | 08cf8a155aebaa2f148677f1fb766733e718440f (diff) | |
download | plus-dee232be436909e84a39e9bc3e8949dbaba38e05.tar.gz plus-dee232be436909e84a39e9bc3e8949dbaba38e05.tar.bz2 plus-dee232be436909e84a39e9bc3e8949dbaba38e05.tar.xz plus-dee232be436909e84a39e9bc3e8949dbaba38e05.zip |
Add to OpenGL renderers function for clear screen.
Diffstat (limited to 'src')
-rw-r--r-- | src/render/graphics.h | 3 | ||||
-rw-r--r-- | src/render/mobileopenglgraphics.cpp | 5 | ||||
-rw-r--r-- | src/render/normalopenglgraphics.cpp | 5 | ||||
-rw-r--r-- | src/render/nullopenglgraphics.cpp | 4 | ||||
-rw-r--r-- | src/render/openglgraphicsdef.hpp | 2 | ||||
-rw-r--r-- | src/render/safeopenglgraphics.cpp | 5 |
6 files changed, 24 insertions, 0 deletions
diff --git a/src/render/graphics.h b/src/render/graphics.h index d26f8a770..58e08888a 100644 --- a/src/render/graphics.h +++ b/src/render/graphics.h @@ -444,6 +444,9 @@ class Graphics virtual void endDraw() { } + virtual void clearScreen() const + { } + int mWidth; int mHeight; int mActualWidth; diff --git a/src/render/mobileopenglgraphics.cpp b/src/render/mobileopenglgraphics.cpp index 58760ce60..8150c4f66 100644 --- a/src/render/mobileopenglgraphics.cpp +++ b/src/render/mobileopenglgraphics.cpp @@ -1318,6 +1318,11 @@ void MobileOpenGLGraphics::calcImageRect(ImageVertexes *const vert, #include "render/graphics_calcImageRect.hpp" } +void MobileOpenGLGraphics::clearScreen() const +{ + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); +} + #ifdef DEBUG_BIND_TEXTURE void MobileOpenGLGraphics::debugBindTexture(const Image *const image) { diff --git a/src/render/normalopenglgraphics.cpp b/src/render/normalopenglgraphics.cpp index c8fe89c89..75064a435 100644 --- a/src/render/normalopenglgraphics.cpp +++ b/src/render/normalopenglgraphics.cpp @@ -1607,6 +1607,11 @@ void NormalOpenGLGraphics::calcImageRect(ImageVertexes *const vert, #include "render/graphics_calcImageRect.hpp" } +void NormalOpenGLGraphics::clearScreen() const +{ + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); +} + #ifdef DEBUG_BIND_TEXTURE void NormalOpenGLGraphics::debugBindTexture(const Image *const image) { diff --git a/src/render/nullopenglgraphics.cpp b/src/render/nullopenglgraphics.cpp index 40a952db8..ca6fa1660 100644 --- a/src/render/nullopenglgraphics.cpp +++ b/src/render/nullopenglgraphics.cpp @@ -1185,6 +1185,10 @@ void NullOpenGLGraphics::calcImageRect(ImageVertexes *const vert, #include "render/graphics_calcImageRect.hpp" } +void NullOpenGLGraphics::clearScreen() const +{ +} + #ifdef DEBUG_BIND_TEXTURE void NullOpenGLGraphics::debugBindTexture(const Image *const image) { diff --git a/src/render/openglgraphicsdef.hpp b/src/render/openglgraphicsdef.hpp index 4315d4115..1df90e3ee 100644 --- a/src/render/openglgraphicsdef.hpp +++ b/src/render/openglgraphicsdef.hpp @@ -49,6 +49,8 @@ public: bool isAllowScale() const override final { return true; } + void clearScreen() const override final; + static void bindTexture(const GLenum target, const GLuint texture); static GLuint mLastImage; diff --git a/src/render/safeopenglgraphics.cpp b/src/render/safeopenglgraphics.cpp index 58ab99923..236e09841 100644 --- a/src/render/safeopenglgraphics.cpp +++ b/src/render/safeopenglgraphics.cpp @@ -722,6 +722,11 @@ void SafeOpenGLGraphics::restoreColor() mByteColor = mColor; } +void SafeOpenGLGraphics::clearScreen() const +{ + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); +} + void SafeOpenGLGraphics::drawImageRect(const int x, const int y, const int w, const int h, const ImageRect &imgRect) |