diff --git a/nanoWrap.cpp b/nanoWrap.cpp
index eea514e1ea6570eca3781965a7eba33f70c6e0d0..c13aea311d72a7f902275de277d4f156227a7039 100644 (file)
--- a/nanoWrap.cpp
+++ b/nanoWrap.cpp
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include "gl.h"
#include "glesinterface.h"
+#include "nanogl.h"
#define GL_TEXTURE0_ARB 0x84C0
#define GL_TEXTURE1_ARB 0x84C1
#endif
};
-static VertexAttrib vertexattribs[8000];
+static VertexAttrib vertexattribs[40000];
static GLushort indexArray[30000];
arraysValid = GL_FALSE;
}
+void ResetNanoState()
+{
+
+ if (tmuState0.color_array.enabled)
+ {
+ glEsImpl->glEnableClientState(GL_COLOR_ARRAY);
+ }
+ else
+ {
+ glEsImpl->glDisableClientState(GL_COLOR_ARRAY);
+ }
+
+ if (tmuState0.vertex_array.enabled)
+ {
+ glEsImpl->glEnableClientState(GL_VERTEX_ARRAY);
+ }
+ else
+ {
+ glEsImpl->glDisableClientState(GL_VERTEX_ARRAY);
+ }
+
+ if (tmuState0.texture_coord_array.enabled)
+ {
+ glEsImpl->glEnableClientState(GL_TEXTURE_COORD_ARRAY);
+ }
+ else
+ {
+ glEsImpl->glDisableClientState(GL_TEXTURE_COORD_ARRAY);
+ }
+ glEsImpl->glVertexPointer(tmuState0.vertex_array.size,
+ tmuState0.vertex_array.type,
+ tmuState0.vertex_array.stride,
+ tmuState0.vertex_array.ptr);
+
+ glEsImpl->glTexCoordPointer(tmuState0.texture_coord_array.size,
+ tmuState0.texture_coord_array.type,
+ tmuState0.texture_coord_array.stride,
+ tmuState0.texture_coord_array.ptr);
+
+ glEsImpl->glColorPointer(tmuState0.color_array.size,
+ tmuState0.color_array.type,
+ tmuState0.color_array.stride,
+ tmuState0.color_array.ptr);
+
+ glEsImpl->glMatrixMode(nanoglState.matrixmode);
+
+
+
+ glEsImpl->glColor4f (currentVertexAttrib.red, currentVertexAttrib.green, currentVertexAttrib.blue, currentVertexAttrib.alpha);
+
+ glEsImpl->glBlendFunc(nanoglState.sfactor, nanoglState.dfactor);
+
+ //glEsImpl->glBindTexture(GL_TEXTURE_2D, stackTextureState);
+
+ glEsImpl->glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, activetmuState->texture_env_mode.value);
+
+ arraysValid = GL_FALSE;
+}
void FlushOnStateChange()
{
if (delayedttmuchange)
{
delayedttmuchange = GL_FALSE;
+#ifndef USE_CORE_PROFILE
glEsImpl->glActiveTexture(delayedtmutarget);
+#endif
}
if (!vertexCount)
ptrIndexArray = indexArray;
useTexCoordArray = GL_FALSE;
}
-
+void nanoGL_Flush()
+ {
+ FlushOnStateChange();
+ }
+void nanoGL_Reset()
+{
+ ResetNanoState();
+}
void glBegin(GLenum mode)
{
wrapperPrimitiveMode = mode;
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)
nanoglState.depth_range_far = zFar;
}
FlushOnStateChange();
+#ifdef USE_CORE_PROFILE
+ glEsImpl->glDepthRange(zNear, zFar);
+#else
glEsImpl->glDepthRangef(zNear, zFar);
+#endif
}
void glDepthFunc (GLenum func)
@@ -1353,7 +1430,7 @@ void glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
GLenum glGetError (void)
{
- FlushOnStateChange();
+ //FlushOnStateChange();
return GL_NO_ERROR;//glEsImpl->glGetError();
}