|
@@ -4,7 +4,9 @@
|
|
|
#include <stdio.h>
|
|
|
#include <stdlib.h>
|
|
|
#include <string.h>
|
|
|
-#include <EGL/egl.h>
|
|
|
+
|
|
|
+void* SDL_GL_GetProcAddress( const char *proc );
|
|
|
+int SDL_GL_ExtensionSupported( const char *extension );
|
|
|
|
|
|
namespace bbGLexts{
|
|
|
|
|
@@ -17,28 +19,21 @@ namespace bbGLexts{
|
|
|
|
|
|
void init(){
|
|
|
|
|
|
- const char *exts=(const char*)glGetString( GL_EXTENSIONS );
|
|
|
- char *buf=(char*)malloc( strlen( exts )+3 );
|
|
|
-
|
|
|
- buf[0]=' ';
|
|
|
- strcpy( buf+1,exts );
|
|
|
- strcat( buf+1," " );
|
|
|
-
|
|
|
- if( GL_draw_buffers=strstr( buf," GL_EXT_draw_buffers " ) ){
|
|
|
+ if( GL_draw_buffers=SDL_GL_ExtensionSupported( "GL_EXT_draw_buffer" ) ){
|
|
|
|
|
|
- glDrawBuffers=(void(*)(int,const GLenum*)) eglGetProcAddress( "glDrawBuffersEXT" );
|
|
|
+ glDrawBuffers=(void(*)(int,const GLenum*)) SDL_GL_GetProcAddress( "glDrawBuffersEXT" );
|
|
|
|
|
|
- }else if( GL_draw_buffers=strstr( buf," WEBGL_draw_buffers " ) ){
|
|
|
+ }else if( GL_draw_buffers=SDL_GL_ExtensionSupported( "GL_WEBGL_draw_buffer" ) ){
|
|
|
|
|
|
- glDrawBuffers=(void(*)(int,const GLenum*)) eglGetProcAddress( "glDrawBuffersWEBGL" );
|
|
|
+ glDrawBuffers=(void(*)(int,const GLenum*)) SDL_GL_GetProcAddress( "glDrawBuffersWEBGL" );
|
|
|
}
|
|
|
+
|
|
|
+ GL_texture_float=SDL_GL_ExtensionSupported( "GL_OES_texture_float" );
|
|
|
|
|
|
- GL_texture_float=strstr( buf,"_texture_float" );
|
|
|
-
|
|
|
- GL_texture_half_float=strstr( buf,"_texture_half_float" );
|
|
|
+ GL_texture_half_float=SDL_GL_ExtensionSupported( "GL_OES_texture_half_float" );
|
|
|
|
|
|
- GL_depth_texture=strstr( buf,"_depth_texture" );
|
|
|
-
|
|
|
+ GL_depth_texture=SDL_GL_ExtensionSupported( "GL_OES_depth_texture" );
|
|
|
+
|
|
|
printf( "GL_draw_buffers=%i\n",int( GL_draw_buffers ) );
|
|
|
printf( "GL_texture_float=%i\n",int( GL_texture_float ) );
|
|
|
printf( "GL_texture_half_float=%i\n",int( GL_texture_half_float ) );
|