OSDN Git Service

mesa: implement _mesa_GetStringi() for GL3
authorBrian Paul <brianp@vmware.com>
Wed, 30 Dec 2009 17:30:16 +0000 (10:30 -0700)
committerBrian Paul <brianp@vmware.com>
Wed, 30 Dec 2009 17:30:23 +0000 (10:30 -0700)
Note: not plugged into the dispatch table yet.

src/mesa/main/get.h
src/mesa/main/getstring.c

index 076ab7a..cc426fc 100644 (file)
@@ -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 );
 
index 6599ed9..cac5eef 100644 (file)
@@ -184,6 +184,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.
  *
  * \param pname  names state to be queried