diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-10-17 02:24:54 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-10-17 14:55:08 +0300 |
commit | 5a322df4da3102ae0c8d3bc3071386dc5f21e580 (patch) | |
tree | 4ca0cca3328baf7484074ad6e1cf9c5a9f9e3db0 /src/normalopenglgraphics.cpp | |
parent | e6e36b25a696212f0262e3e5ef520543b1b3a58b (diff) | |
download | plus-5a322df4da3102ae0c8d3bc3071386dc5f21e580.tar.gz plus-5a322df4da3102ae0c8d3bc3071386dc5f21e580.tar.bz2 plus-5a322df4da3102ae0c8d3bc3071386dc5f21e580.tar.xz plus-5a322df4da3102ae0c8d3bc3071386dc5f21e580.zip |
Add OpenGL support for Android builds (partially).
Diffstat (limited to 'src/normalopenglgraphics.cpp')
-rw-r--r-- | src/normalopenglgraphics.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/normalopenglgraphics.cpp b/src/normalopenglgraphics.cpp index 32175c05f..cc0e05b3f 100644 --- a/src/normalopenglgraphics.cpp +++ b/src/normalopenglgraphics.cpp @@ -40,11 +40,6 @@ #include "debug.h" -#ifndef GL_TEXTURE_RECTANGLE_ARB -#define GL_TEXTURE_RECTANGLE_ARB 0x84F5 -#define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8 -#endif - GLuint NormalOpenGLGraphics::mLastImage = 0; unsigned int vertexBufSize = 500; @@ -949,8 +944,13 @@ void NormalOpenGLGraphics::_beginDraw() glMatrixMode(GL_PROJECTION); glLoadIdentity(); +#ifdef ANDROID + glOrthof(0.0, static_cast<float>(mTarget->w), + static_cast<float>(mTarget->h), 0.0, -1.0, 1.0); +#else glOrtho(0.0, static_cast<double>(mTarget->w), static_cast<double>(mTarget->h), 0.0, -1.0, 1.0); +#endif glMatrixMode(GL_MODELVIEW); glLoadIdentity(); @@ -963,14 +963,15 @@ void NormalOpenGLGraphics::_beginDraw() glEnableClientState(GL_VERTEX_ARRAY); glDisableClientState(GL_TEXTURE_COORD_ARRAY); +#ifndef ANDROID glHint(GL_LINE_SMOOTH_HINT, GL_FASTEST); glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST); glHint(GL_POINT_SMOOTH_HINT, GL_FASTEST); glHint(GL_POLYGON_SMOOTH_HINT, GL_FASTEST); - #ifndef __MINGW32__ glHint(GL_TEXTURE_COMPRESSION_HINT, GL_FASTEST); #endif +#endif // glScalef(0.5f, 0.5f, 0.5f); @@ -1093,9 +1094,13 @@ void NormalOpenGLGraphics::drawPoint(int x, int y) setTexturingAndBlending(false); restoreColor(); +#ifdef ANDROID + // TODO need fix +#else glBegin(GL_POINTS); glVertex2i(x, y); glEnd(); +#endif } void NormalOpenGLGraphics::drawLine(int x1, int y1, int x2, int y2) |