1.1 --- a/src/pvr2/glutil.c Sat Jan 26 14:00:48 2013 +1000
1.2 +++ b/src/pvr2/glutil.c Fri May 29 18:47:05 2015 +1000
1.5 gboolean isOpenGLES2()
1.7 - const char *str = glGetString(GL_VERSION);
1.8 - if( strncmp(str, "OpenGL ES 2.", 12) == 0 ) {
1.9 + const GLubyte *str = glGetString(GL_VERSION);
1.10 + if( strncmp((const char *)str, "OpenGL ES 2.", 12) == 0 ) {
1.17 gchar *ext_dup = g_strdup(extensions);
1.18 - gchar **ext_split = g_strsplit(g_strstrip(extensions), " ", 0);
1.19 + gchar **ext_split = g_strsplit(g_strstrip(ext_dup), " ", 0);
1.20 for( count = 0; ext_split[count] != NULL; count++ ) {
1.21 unsigned len = strlen(ext_split[count]);
1.28 static int bgra_to_rgba_type( int glFormatType )
1.30 switch( glFormatType ) {
1.32 return glFormatType;
1.38 * Convert BGRA data in buffer to RGBA format in-place (for systems that don't natively
1.41 static int bgra_to_rgba( unsigned char *data, unsigned nPixels, int glFormatType )
1.44 switch( glFormatType ) {
1.45 case GL_UNSIGNED_SHORT_1_5_5_5_REV: {
1.46 uint16_t *p = (uint16_t *)data;
1.48 if( format == GL_BGRA && !display_driver->capabilities.has_bgra ) {
1.49 if( preserveData ) {
1.50 size_t size = width * height * (type == GL_UNSIGNED_BYTE ? 4 : 2);
1.52 + unsigned char buf[size];
1.53 memcpy(buf, data, size);
1.54 GLint rgbaType = bgra_to_rgba( buf, width*height, type );
1.55 glTexImage2D( GL_TEXTURE_2D, level, intFormat, width, height, 0, GL_RGBA, rgbaType,
1.57 if( format == GL_BGRA && !display_driver->capabilities.has_bgra ) {
1.58 if( preserveData ) {
1.59 size_t size = width * height * (type == GL_UNSIGNED_BYTE ? 4 : 2);
1.61 + unsigned char buf[size];
1.62 memcpy(buf, data, size);
1.63 GLint rgbaType = bgra_to_rgba( buf, width*height, type );
1.64 glTexSubImage2D( GL_TEXTURE_2D, level, xoff, yoff, width, height, GL_RGBA, rgbaType,