summaryrefslogtreecommitdiff
path: root/src/glx/x11/glxextensions.c
diff options
context:
space:
mode:
authorIan Romanick <idr@us.ibm.com>2005-02-22 22:36:31 +0000
committerIan Romanick <idr@us.ibm.com>2005-02-22 22:36:31 +0000
commitfdb07636f2e6324c5250cd5ee97778b7f5933bea (patch)
tree7914282adbac014b4d48b8ab78c03c73b6a72052 /src/glx/x11/glxextensions.c
parentcb83f62e307be90532fcc58a0e5dd3e8cc7411b2 (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.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/glx/x11/glxextensions.c b/src/glx/x11/glxextensions.c
index 9623cdfc25..f4e07efeb0 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 ) );
}