diff --git a/nanoWrap.cpp b/nanoWrap.cpp
index 5c5eec805314a6a8deb061897e67b88e7b0e7d54..b9097386b430fd2920a8f23e63a567b96f2292b1 100644 (file)
--- 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,
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,