summaryrefslogtreecommitdiff
path: root/src/render/normalopenglgraphics.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-06-14 02:17:38 +0300
committerAndrei Karas <akaras@inbox.ru>2014-06-14 11:41:50 +0300
commiteecd33fff488d54d038d84d8676000fad826e940 (patch)
tree9eb6c12810579d52c8df16e43d294852ba5613bb /src/render/normalopenglgraphics.cpp
parent4b8a6d93c5a785c673ec6c9f8a09880c48dee065 (diff)
downloadmanaverse-eecd33fff488d54d038d84d8676000fad826e940.tar.gz
manaverse-eecd33fff488d54d038d84d8676000fad826e940.tar.bz2
manaverse-eecd33fff488d54d038d84d8676000fad826e940.tar.xz
manaverse-eecd33fff488d54d038d84d8676000fad826e940.zip
fix modernoepngl drawing.
Add simple draw test in most renders.
Diffstat (limited to 'src/render/normalopenglgraphics.cpp')
-rw-r--r--src/render/normalopenglgraphics.cpp56
1 files changed, 56 insertions, 0 deletions
diff --git a/src/render/normalopenglgraphics.cpp b/src/render/normalopenglgraphics.cpp
index 2348fa22b..3dd5392ae 100644
--- a/src/render/normalopenglgraphics.cpp
+++ b/src/render/normalopenglgraphics.cpp
@@ -339,6 +339,62 @@ bool NormalOpenGLGraphics::drawImageInline(const Image *const image,
return true;
}
+void NormalOpenGLGraphics::testDraw()
+{
+ if (OpenGLImageHelper::mTextureType == GL_TEXTURE_2D)
+ {
+ GLfloat tex[] =
+ {
+ 0.0f, 0.0f,
+ 1.0f, 0.0f,
+ 1.0f, 1.0f,
+ 0.0f, 1.0f
+ };
+
+ GLint vert[] =
+ {
+ 0, 0,
+ 800, 0,
+ 800, 600,
+ 0, 600
+ };
+
+ glVertexPointer(2, GL_INT, 0, &vert);
+ glTexCoordPointer(2, GL_FLOAT, 0, &tex);
+
+#ifdef DEBUG_DRAW_CALLS
+ NormalOpenGLGraphics::mDrawCalls ++;
+#endif
+ glDrawArrays(GL_QUADS, 0, 4);
+ }
+ else
+ {
+ GLint tex[] =
+ {
+ 0, 0,
+ 800, 0,
+ 800, 600,
+ 0, 600
+ };
+
+ GLint vert[] =
+ {
+ 0, 0,
+ 800, 0,
+ 800, 600,
+ 0, 600
+ };
+
+ glVertexPointer(2, GL_INT, 0, &vert);
+ glTexCoordPointer(2, GL_INT, 0, &tex);
+
+#ifdef DEBUG_DRAW_CALLS
+ NormalOpenGLGraphics::mDrawCalls ++;
+#endif
+ glDrawArrays(GL_QUADS, 0, 4);
+ }
+}
+
void NormalOpenGLGraphics::drawImageCached(const Image *const image,
int x, int y)
{