diff options
author | Ian Romanick <[email protected]> | 2005-02-22 22:36:31 +0000 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2005-02-22 22:36:31 +0000 |
commit | fdb07636f2e6324c5250cd5ee97778b7f5933bea (patch) | |
tree | 7914282adbac014b4d48b8ab78c03c73b6a72052 /src/glx/x11/glxextensions.c | |
parent | cb83f62e307be90532fcc58a0e5dd3e8cc7411b2 (diff) |
Added __glExtensionBiIsEnabled and __GLXcontext::gl_extension_bits. This
enables libGL to query which extension are exported to applications.
Refactored array-query functionality (from glGet*v) in src/glx/x11/single2.c.
Massive re-write of indirect vertex array support. The most noticable
effect is that glDrawElements now generates DrawArrays protocol. The
side-effects (and the main reasons for the re-work) are that it is much
easier to add support for new arrays (e.g., GL_VERTEX_ATTRIB_ARRAY,
GL_WEIGHT_ARRAY_ARB, etc.) and it is much easier to add support for the new
DrawArrays protocol (required to support ARB_vertex_buffer_object).
These changes were primarilly tested with progs/demos/isosurf.
Diffstat (limited to 'src/glx/x11/glxextensions.c')
-rw-r--r-- | src/glx/x11/glxextensions.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/glx/x11/glxextensions.c b/src/glx/x11/glxextensions.c index 9623cdfc258..f4e07efeb07 100644 --- a/src/glx/x11/glxextensions.c +++ b/src/glx/x11/glxextensions.c @@ -237,8 +237,6 @@ static const struct extension_info known_gl_extensions[] = { }; -#define __GL_EXT_BYTES ((__NUM_GL_EXTS + 7) / 8) - /* global bit-fields of available extensions and their characteristics */ static unsigned char client_glx_support[8]; static unsigned char client_glx_only[8]; @@ -494,6 +492,24 @@ __glXExtensionBitIsEnabled( __GLXscreenConfigs *psc, unsigned bit ) /** + * Check if a certain extension is enabled in a given context. + * + */ +GLboolean +__glExtensionBitIsEnabled( const __GLXcontext * gc, unsigned bit ) +{ + GLboolean enabled = GL_FALSE; + + if ( gc != NULL ) { + enabled = EXT_ENABLED( bit, gc->gl_extension_bits ); + } + + return enabled; +} + + + +/** * Convert a bit-field to a string of supported extensions. */ static char * @@ -680,6 +696,7 @@ __glXCalculateUsableGLExtensions( __GLXcontext * gc, gc->extensions = (unsigned char *) __glXGetStringFromTable( known_gl_extensions, usable ); + (void) memcpy( gc->gl_extension_bits, usable, sizeof( usable ) ); } |