Search
lxdream.org :: lxdream/src/pvr2/glutil.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/pvr2/glutil.c
changeset 1298:d0eb2307b847
prev1296:30ecee61f811
author nkeynes
date Wed Feb 04 08:38:23 2015 +1000 (9 years ago)
permissions -rw-r--r--
last change Fix assorted compile warnings reported by Clang
file annotate diff log raw
1.1 --- a/src/pvr2/glutil.c Sat Jan 26 14:00:48 2013 +1000
1.2 +++ b/src/pvr2/glutil.c Wed Feb 04 08:38:23 2015 +1000
1.3 @@ -24,8 +24,8 @@
1.4
1.5 gboolean isOpenGLES2()
1.6 {
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.11 return TRUE;
1.12 }
1.13 return FALSE;
1.14 @@ -192,7 +192,7 @@
1.15 return;
1.16
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.22 if( len > maxlen )
1.23 @@ -264,6 +264,7 @@
1.24 return TRUE;
1.25 }
1.26
1.27 +#if 0
1.28 static int bgra_to_rgba_type( int glFormatType )
1.29 {
1.30 switch( glFormatType ) {
1.31 @@ -278,6 +279,7 @@
1.32 return glFormatType;
1.33 }
1.34 }
1.35 +#endif
1.36
1.37 /**
1.38 * Convert BGRA data in buffer to RGBA format in-place (for systems that don't natively
1.39 @@ -290,7 +292,6 @@
1.40 */
1.41 static int bgra_to_rgba( unsigned char *data, unsigned nPixels, int glFormatType )
1.42 {
1.43 - unsigned i;
1.44 switch( glFormatType ) {
1.45 case GL_UNSIGNED_SHORT_1_5_5_5_REV: {
1.46 uint16_t *p = (uint16_t *)data;
1.47 @@ -333,7 +334,7 @@
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.51 - char buf[size];
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.56 @@ -354,7 +355,7 @@
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.60 - char buf[size];
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,
.