X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=nanoWrap.cpp;h=b9097386b430fd2920a8f23e63a567b96f2292b1;hb=0e9592776617e9e83e7af878035f69fe7b5c094a;hp=5c5eec805314a6a8deb061897e67b88e7b0e7d54;hpb=5bb54c3b963ff631c41dae7c87687f930a3b8c7d;p=nanogl.git diff --git a/nanoWrap.cpp b/nanoWrap.cpp index 5c5eec8..b909738 100644 --- a/nanoWrap.cpp +++ b/nanoWrap.cpp @@ -1281,7 +1281,7 @@ void glTexImage2D( GLenum target, GLint level, GLint internalformat, GLsizei wid { unsigned char *data = (unsigned char*)pixels; - if( internalformat == GL_RGB && format == GL_RGBA ) // strip alpha from texture + if( pixels && internalformat == GL_RGB && format == GL_RGBA ) // strip alpha from texture { unsigned char *in = data, *out; int i = 0, size = width * height * 4; @@ -1913,6 +1913,9 @@ void glDrawElements( GLenum mode, GLsizei count, GLenum type, const GLvoid *indi else { glEsImpl->glDisableClientState( GL_COLOR_ARRAY ); + glEsImpl->glColor4f( currentVertexAttrib.red/255.0f, currentVertexAttrib.green/255.0f, + currentVertexAttrib.blue/255.0f, currentVertexAttrib.alpha/255.0f ); + } glEsImpl->glColorPointer( tmuState0.color_array.size, tmuState0.color_array.type, @@ -2385,6 +2388,9 @@ void glDrawArrays( GLenum mode, GLint first, GLsizei count ) else { glEsImpl->glDisableClientState( GL_COLOR_ARRAY ); + glEsImpl->glColor4f( currentVertexAttrib.red/255.0f, currentVertexAttrib.green/255.0f, + currentVertexAttrib.blue/255.0f, currentVertexAttrib.alpha/255.0f ); + } glEsImpl->glColorPointer( tmuState0.color_array.size, tmuState0.color_array.type,