mesa: implement GL3 GL_NUM_EXTENSIONS query

This commit is contained in:
Brian Paul
2009-12-30 10:16:01 -07:00
parent 1ec6de9f94
commit 802b808939
5 changed files with 46 additions and 0 deletions

View File

@@ -700,3 +700,28 @@ _mesa_make_extension_string( GLcontext *ctx )
return (GLubyte *) s;
}
/**
* Return number of enabled extensions.
*/
GLuint
_mesa_get_extension_count(GLcontext *ctx)
{
GLuint i;
/* only count once */
if (!ctx->Extensions.Count) {
for (i = 0; i < Elements(default_extensions); i++) {
if (extension_enabled(ctx, i)) {
ctx->Extensions.Count++;
}
}
}
if (0)
_mesa_debug(ctx, "%u of %d extensions enabled\n", ctx->Extensions.Count,
Elements(default_extensions));
return ctx->Extensions.Count;
}