From: mittorn Date: Mon, 25 Jul 2016 21:00:32 +0000 (+0000) Subject: Fix arrays overflow by check in glEnd, add missing stubs X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=fba28cfff8c488b83b052b92a9f58678c90f2afe;p=nanogl.git Fix arrays overflow by check in glEnd, add missing stubs --- diff --git a/GL/gl.h b/GL/gl.h index 37a2a84..605864b 100644 --- a/GL/gl.h +++ b/GL/gl.h @@ -719,6 +719,7 @@ void glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderb void glNormalPointer(GLenum type, GLsizei stride, const void *ptr); void glMultiTexCoord3f(GLenum, GLfloat, GLfloat, GLfloat); +void glMultiTexCoord3fARB(GLenum, GLfloat, GLfloat, GLfloat); void glMultiTexCoord2f(GLenum, GLfloat, GLfloat); diff --git a/nanoWrap.cpp b/nanoWrap.cpp index a2189f3..cdb9313 100644 --- a/nanoWrap.cpp +++ b/nanoWrap.cpp @@ -209,9 +209,9 @@ struct VertexAttrib #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; @@ -511,6 +511,9 @@ void glEnd(void) default: break; } + if( ptrVertexAttribArray - vertexattribs > 20000 * sizeof(VertexAttrib) || + ptrIndexArray - indexArray > 15000 * sizeof(GLushort) ) + FlushOnStateChange(); } void glEnable (GLenum cap) @@ -1942,9 +1945,9 @@ void glTexEnvi (GLenum target, GLenum pname, GLint param) glEsImpl->glTexEnvi(target, pname, param); } -void glMultiTexCoord3fARB(GLenum, GLfloat, GLfloat, GLfloat) +void glMultiTexCoord3fARB(GLenum a, GLfloat b, GLfloat c, GLfloat) { - + return glMultiTexCoord2fARB(a, b, c); } void glMultiTexCoord2f(GLenum, GLfloat, GLfloat)