filename | src/pvr2/glutil.c |
changeset | 1258:f8a9c0fd2abb |
prev | 1248:0ea1904e2b14 |
next | 1275:83b15705cdde |
author | nkeynes |
date | Mon Mar 05 15:00:14 2012 +1000 (12 years ago) |
permissions | -rw-r--r-- |
last change | Revert to using GL_QUADS when available, fallback to fan-strip when it's not (GLES) |
file | annotate | diff | log | raw |
1.1 --- a/src/pvr2/glutil.c Sat Mar 03 15:56:29 2012 +10001.2 +++ b/src/pvr2/glutil.c Mon Mar 05 15:00:14 2012 +10001.3 @@ -21,6 +21,14 @@1.4 #include <glib/gstrfuncs.h>1.5 #include "pvr2/glutil.h"1.7 +gboolean isOpenGLES2()1.8 +{1.9 + const char *str = glGetString(GL_VERSION);1.10 + if( strncmp(str, "OpenGL ES 2.", 12) == 0 ) {1.11 + return TRUE;1.12 + }1.13 +}1.14 +1.15 gboolean isGLSecondaryColorSupported()1.16 {1.17 return isGLExtensionSupported("GL_EXT_secondary_color");1.18 @@ -41,12 +49,12 @@1.19 return isGLExtensionSupported("GL_ARB_texture_mirrored_repeat");1.20 }1.22 -gboolean isOpenGLES2()1.23 +1.24 +gboolean isGLShaderSupported()1.25 {1.26 - const char *str = glGetString(GL_VERSION);1.27 - if( strncmp(str, "OpenGL ES 2.", 12) == 0 ) {1.28 - return TRUE;1.29 - }1.30 + return isOpenGLES2() || (isGLExtensionSupported("GL_ARB_fragment_shader") &&1.31 + isGLExtensionSupported("GL_ARB_vertex_shader") &&1.32 + isGLExtensionSupported("GL_ARB_shading_language_100"));1.33 }1.35 /**1.36 @@ -206,9 +214,8 @@1.37 fprintf( out, "GL Vendor: %s\n", glGetString(GL_VENDOR) );1.38 fprintf( out, "GL Renderer: %s\n", glGetString(GL_RENDERER) );1.39 fprintf( out, "GL Version: %s\n", glGetString(GL_VERSION) );1.40 - if( glsl_is_supported() ) {1.41 - const char * version = glsl_get_version();1.42 - fprintf( out, "SL Version: %s\n", version );1.43 + if( isGLShaderSupported() ) {1.44 + fprintf( out, "SL Version: %s\n", glGetString(GL_SHADING_LANGUAGE_VERSION) );1.45 }1.47 fprintf( out, "GL Extensions:\n" );
.