Search
lxdream.org :: lxdream/src/pvr2/glutil.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/pvr2/glutil.c
changeset 1258:f8a9c0fd2abb
prev1248:0ea1904e2b14
next1275:83b15705cdde
author nkeynes
date Mon Mar 05 11:41:03 2012 +1000 (8 years ago)
permissions -rw-r--r--
last change Small cleanups:
Refactor the post-windowing setup into gl_init_driver() in video_gl.c
Move gl_sl.c into src/drivers and tidy up a bit.
Fix OS X compiling plugins with -mdynamic-no-pic
file annotate diff log raw
1.1 --- a/src/pvr2/glutil.c Sat Mar 03 15:56:29 2012 +1000
1.2 +++ b/src/pvr2/glutil.c Mon Mar 05 11:41:03 2012 +1000
1.3 @@ -21,6 +21,14 @@
1.4 #include <glib/gstrfuncs.h>
1.5 #include "pvr2/glutil.h"
1.6
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.21
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.34
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.46
1.47 fprintf( out, "GL Extensions:\n" );
.