From 16e91d4c0e1088f5c4098b01b4b7bf670cd66c4a Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 30 Dec 2009 10:30:16 -0700 Subject: mesa: implement _mesa_GetStringi() for GL3 Note: not plugged into the dispatch table yet. --- src/mesa/main/get.h | 3 +++ src/mesa/main/getstring.c | 28 ++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) (limited to 'src') diff --git a/src/mesa/main/get.h b/src/mesa/main/get.h index 076ab7a58b..cc426fc0f6 100644 --- a/src/mesa/main/get.h +++ b/src/mesa/main/get.h @@ -65,6 +65,9 @@ _mesa_GetPointerv( GLenum pname, GLvoid **params ); extern const GLubyte * GLAPIENTRY _mesa_GetString( GLenum name ); +extern const GLubyte * GLAPIENTRY +_mesa_GetStringi(GLenum name, GLuint index); + extern GLenum GLAPIENTRY _mesa_GetError( void ); diff --git a/src/mesa/main/getstring.c b/src/mesa/main/getstring.c index 6599ed9698..cac5eef1cb 100644 --- a/src/mesa/main/getstring.c +++ b/src/mesa/main/getstring.c @@ -183,6 +183,34 @@ _mesa_GetString( GLenum name ) } +/** + * GL3 + */ +const GLubyte * GLAPIENTRY +_mesa_GetStringi(GLenum name, GLuint index) +{ + GET_CURRENT_CONTEXT(ctx); + + if (!ctx) + return NULL; + + ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, NULL); + + switch (name) { + case GL_EXTENSIONS: + if (index >= _mesa_get_extension_count(ctx)) { + _mesa_error(ctx, GL_INVALID_VALUE, "glGetStringi(index=%u)", index); + return (const GLubyte *) 0; + } + return _mesa_get_enabled_extension(ctx, index); + default: + _mesa_error( ctx, GL_INVALID_ENUM, "glGetString" ); + return (const GLubyte *) 0; + } +} + + + /** * Return pointer-valued state, such as a vertex array pointer. * -- cgit v1.2.3