Beispiel #1
0
void
__indirect_glGetPointerv(GLenum pname, void **params)
{
   struct glx_context *gc = __glXGetCurrentContext();
   __GLXattribute *state = (__GLXattribute *) (gc->client_state_private);
   Display *dpy = gc->currentDpy;

   if (!dpy)
      return;

   switch (pname) {
   case GL_VERTEX_ARRAY_POINTER:
   case GL_NORMAL_ARRAY_POINTER:
   case GL_COLOR_ARRAY_POINTER:
   case GL_INDEX_ARRAY_POINTER:
   case GL_EDGE_FLAG_ARRAY_POINTER:
      __glXGetArrayPointer(state, pname - GL_VERTEX_ARRAY_POINTER
                           + GL_VERTEX_ARRAY, 0, params);
      return;
   case GL_TEXTURE_COORD_ARRAY_POINTER:
      __glXGetArrayPointer(state, GL_TEXTURE_COORD_ARRAY,
                           __glXGetActiveTextureUnit(state), params);
      return;
   case GL_SECONDARY_COLOR_ARRAY_POINTER:
   case GL_FOG_COORD_ARRAY_POINTER:
      __glXGetArrayPointer(state, pname - GL_FOG_COORD_ARRAY_POINTER
                           + GL_FOG_COORD_ARRAY, 0, params);
      return;
   case GL_FEEDBACK_BUFFER_POINTER:
      *params = (void *) gc->feedbackBuf;
      return;
   case GL_SELECTION_BUFFER_POINTER:
      *params = (void *) gc->selectBuf;
      return;
   default:
      __glXSetError(gc, GL_INVALID_ENUM);
      return;
   }
}
void __indirect_glGetVertexAttribPointervNV( GLuint index, GLenum pname,
					     GLvoid ** pointer )
{
    __GLXcontext * const gc = __glXGetCurrentContext();
    __GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
 
    if ( pname != GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB ) {
	__glXSetError( gc, GL_INVALID_ENUM );
    }
    
    if ( ! __glXGetArrayPointer( state, GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB,
				 index, pointer ) ) {
	__glXSetError( gc, GL_INVALID_VALUE );
    }
}