diff --git a/nanoWrap.cpp b/nanoWrap.cpp
index 5ea8acf7ac6060b1f1c28f5ca5c793603a942c92..8ded7b86f1619add94d252b5bf12c40064dab835 100644 (file)
--- a/nanoWrap.cpp
+++ b/nanoWrap.cpp
#endif
};
-static VertexAttrib vertexattribs[40000];
+static VertexAttrib vertexattribs[60000];
-static GLushort indexArray[30000];
+static GLushort indexArray[50000];
static GLuint vertexCount = 0;
static GLuint indexCount = 0;
default:
break;
}
+ if( ptrVertexAttribArray - vertexattribs > 20000 * sizeof(VertexAttrib) ||
+ ptrIndexArray - indexArray > 15000 * sizeof(GLushort) )
+ FlushOnStateChange();
}
void glEnable (GLenum cap)
#endif
/* Vladimir */
-void glDrawArrays( GLenum mode, int first, int count)
+/*void glDrawArrays( GLenum mode, int first, int count)
{
FlushOnStateChange();
glEsImpl->glDrawArrays(mode, first , count);
-}
+}*/
void glMultMatrixf (const GLfloat *m)
{
FlushOnStateChange();
glEsImpl->glTexEnvi(target, pname, param);
}
-void pglMultiTexCoord3f(GLenum, GLfloat, GLfloat, GLfloat)
+#ifdef __MULTITEXTURE_SUPPORT__
+void glMultiTexCoord3fARB(GLenum a, GLfloat b, GLfloat c, GLfloat)
{
-
+ return glMultiTexCoord2fARB(a, b, c);
}
-void pglMultiTexCoord2f(GLenum, GLfloat, GLfloat)
+void glMultiTexCoord2f(GLenum, GLfloat, GLfloat)
{
}
+#endif
+void glDrawArrays( GLenum mode, GLint first, GLsizei count )
+ {
+ // ensure that all primitives specified between glBegin/glEnd pairs
+ // are rendered first, and that we have correct tmu in use..
+ if( mode == GL_QUADS ) mode = GL_TRIANGLE_FAN;
+ FlushOnStateChange();
+ // setup correct vertex/color/texcoord pointers
+ if (arraysValid ||
+ tmuState0.vertex_array.changed ||
+ tmuState0.color_array.changed ||
+ tmuState0.texture_coord_array.changed || tmuState0.normal_array.changed)
+ {
+ glEsImpl->glClientActiveTexture(GL_TEXTURE0);
+ }
+ if (arraysValid || tmuState0.vertex_array.changed)
+ {
+ if (tmuState0.vertex_array.enabled)
+ {
+ glEsImpl->glEnableClientState(GL_VERTEX_ARRAY);
+ }
+ else
+ {
+ glEsImpl->glDisableClientState(GL_VERTEX_ARRAY);
+ }
+ glEsImpl->glVertexPointer(tmuState0.vertex_array.size,
+ tmuState0.vertex_array.type,
+ tmuState0.vertex_array.stride,
+ tmuState0.vertex_array.ptr);
+ tmuState0.vertex_array.changed = GL_FALSE;
+ }
+ if (arraysValid || tmuState0.color_array.changed)
+ {
+ if (tmuState0.color_array.enabled)
+ {
+ glEsImpl->glEnableClientState(GL_COLOR_ARRAY);
+ }
+ else
+ {
+ glEsImpl->glDisableClientState(GL_COLOR_ARRAY);
+ }
+ glEsImpl->glColorPointer(tmuState0.color_array.size,
+ tmuState0.color_array.type,
+ tmuState0.color_array.stride,
+ tmuState0.color_array.ptr);
+ tmuState0.color_array.changed = GL_FALSE;
+ }
+ if (arraysValid || tmuState0.normal_array.changed)
+ {
+ if (tmuState0.normal_array.enabled)
+ {
+ glEsImpl->glEnableClientState(GL_NORMAL_ARRAY);
+ }
+ else
+ {
+ glEsImpl->glDisableClientState(GL_NORMAL_ARRAY);
+ }
+ glEsImpl->glNormalPointer(tmuState0.normal_array.type,
+ tmuState0.normal_array.stride,
+ tmuState0.normal_array.ptr);
+ tmuState0.normal_array.changed = GL_FALSE;
+ }
+ if (arraysValid || tmuState0.texture_coord_array.changed)
+ {
+ tmuState0.texture_coord_array.changed = GL_FALSE;
+ if (tmuState0.texture_coord_array.enabled)
+ {
+ glEsImpl->glEnableClientState(GL_TEXTURE_COORD_ARRAY);
+ }
+ else
+ {
+ glEsImpl->glDisableClientState(GL_TEXTURE_COORD_ARRAY);
+ }
+ glEsImpl->glTexCoordPointer(tmuState0.texture_coord_array.size,
+ tmuState0.texture_coord_array.type,
+ tmuState0.texture_coord_array.stride,
+ tmuState0.texture_coord_array.ptr);
+ }
+
+ if (arraysValid || tmuState1.texture_coord_array.changed)
+ {
+ tmuState1.texture_coord_array.changed = GL_FALSE;
+ glEsImpl->glClientActiveTexture(GL_TEXTURE1);
+ if (tmuState1.texture_coord_array.enabled)
+ {
+ glEsImpl->glEnableClientState(GL_TEXTURE_COORD_ARRAY);
+ }
+ else
+ {
+ glEsImpl->glDisableClientState(GL_TEXTURE_COORD_ARRAY);
+ }
+ glEsImpl->glTexCoordPointer(tmuState1.texture_coord_array.size,
+ tmuState1.texture_coord_array.type,
+ tmuState1.texture_coord_array.stride,
+ tmuState1.texture_coord_array.ptr);
+ }
+ arraysValid = GL_FALSE;
+ glEsImpl->glDrawArrays(mode, first, count);
+ }
/*void glNormalPointer(GLenum type, GLsizei stride, const void *ptr)
{
glEsImpl->glNormalPointer( type, stride, ptr );
void glGenRenderbuffers( GLsizei n, GLuint* renderbuffers )
{
FlushOnStateChange();
- glEsImpl->glGenFramebuffers( n, renderbuffers );
+ glEsImpl->glGenRenderbuffers( n, renderbuffers );
}
void glBindRenderbuffer(GLenum target, GLuint renderbuffer)