DEADSOFTWARE

Use SDL for GetProcAddress
[nanogl.git] / nanoWrap.cpp
index 27daf14cd5a1c048a61cdf4b50390fbc2c6e7286..c13aea311d72a7f902275de277d4f156227a7039 100644 (file)
@@ -28,6 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 #include "gl.h"
 #include "glesinterface.h"
+#include "nanogl.h"
 
 #define GL_TEXTURE0_ARB                     0x84C0
 #define GL_TEXTURE1_ARB                     0x84C1
@@ -323,7 +324,9 @@ void FlushOnStateChange()
     if (delayedttmuchange)
         {
         delayedttmuchange = GL_FALSE;
+#ifndef USE_CORE_PROFILE
         glEsImpl->glActiveTexture(delayedtmutarget);
+#endif
         }
 
     if (!vertexCount)
@@ -360,7 +363,14 @@ void FlushOnStateChange()
     ptrIndexArray = indexArray;
     useTexCoordArray = GL_FALSE;
     }
-
+void nanoGL_Flush()
+       {
+       FlushOnStateChange();
+       }
+void nanoGL_Reset()
+{
+       ResetNanoState();
+}
 void glBegin(GLenum mode)
     {
     wrapperPrimitiveMode = mode;
@@ -986,7 +996,11 @@ void glColor4f (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
 void glOrtho (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar)
     {
     FlushOnStateChange();
+#ifdef USE_CORE_PROFILE
+       glEsImpl->glOrtho(left,right,bottom,top, zNear,zFar);
+#else
     glEsImpl->glOrthof(left,right,bottom,top, zNear,zFar);
+#endif
     }
 
 void glMatrixMode (GLenum mode)
@@ -1063,7 +1077,11 @@ void glDepthRange(GLclampf zNear, GLclampf zFar)
         nanoglState.depth_range_far = zFar;
         }
     FlushOnStateChange();
+#ifdef USE_CORE_PROFILE
+       glEsImpl->glDepthRange(zNear, zFar);
+#else
     glEsImpl->glDepthRangef(zNear, zFar);
+#endif
     }
 
 void glDepthFunc (GLenum func)
@@ -1412,7 +1430,7 @@ void glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
 
 GLenum glGetError (void)
     {
-    FlushOnStateChange();
+    //FlushOnStateChange();
     return GL_NO_ERROR;//glEsImpl->glGetError();
     }