diff options
Diffstat (limited to 'src/qgl_api.c')
-rw-r--r-- | src/qgl_api.c | 42 |
1 files changed, 10 insertions, 32 deletions
diff --git a/src/qgl_api.c b/src/qgl_api.c index e9503f3..0ee81a8 100644 --- a/src/qgl_api.c +++ b/src/qgl_api.c @@ -1137,40 +1137,18 @@ void QGL_InitExtensions( unsigned mask ) { #undef GPA -// must match defines in qgl_api.h! -static const char *const extnames[] = { - "GL_EXT_compiled_vertex_array", - "GL_ARB_multitexture", - "GL_EXT_texture_filter_anisotropic", - "GL_ARB_fragment_program", - "GL_ARB_vertex_buffer_object" -}; - -static const int numextnames = sizeof( extnames ) / sizeof( extnames[0] ); - unsigned QGL_ParseExtensionString( const char *s ) { - unsigned mask = 0; - const char *p; - size_t l1, l2; - int i; - - while( *s ) { - p = Q_strchrnul( s, ' ' ); - l1 = p - s; - for( i = 0; i < numextnames; i++ ) { - l2 = strlen( extnames[i] ); - if( l1 == l2 && !memcmp( s, extnames[i], l1 ) ) { - mask |= 1 << i; - break; - } - } - if( !*p ) { - break; - } - s = p + 1; - } + // must match defines in qgl_api.h! + static const char *const extnames[] = { + "GL_EXT_compiled_vertex_array", + "GL_ARB_multitexture", + "GL_EXT_texture_filter_anisotropic", + "GL_ARB_fragment_program", + "GL_ARB_vertex_buffer_object", + NULL + }; - return mask; + return Com_ParseExtensionString( s, extnames ); } void QGL_EnableLogging( qboolean enable ) |