aboutsummaryrefslogtreecommitdiffstats
path: root/src/glx/x11/single2.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/glx/x11/single2.c')
-rw-r--r--src/glx/x11/single2.c409
1 files changed, 179 insertions, 230 deletions
diff --git a/src/glx/x11/single2.c b/src/glx/x11/single2.c
index 9279b56845f..f4dfd297995 100644
--- a/src/glx/x11/single2.c
+++ b/src/glx/x11/single2.c
@@ -35,9 +35,11 @@
*/
#include <stdio.h>
+#include <assert.h>
#include "glxclient.h"
#include "packsingle.h"
#include "glxextensions.h"
+#include "indirect_vertex_array.h"
/* Used for GL_ARB_transpose_matrix */
static void TransposeMatrixf(GLfloat m[16])
@@ -134,24 +136,106 @@ GLenum __indirect_glGetError(void)
return retval;
}
-#define CASE_ARRAY_ENABLE(enum_name,array,dest,gl_type) \
- case GL_ ## enum_name ## _ARRAY: \
- *dest = (gl_type) (IS_ARRAY_ENABLED(state, array)); break
-#define CASE_ARRAY_SIZE(enum_name,array,dest,gl_type) \
- case GL_ ## enum_name ## _ARRAY_SIZE: \
- *dest = (gl_type) state->vertArray.arrays[array ## _ARRAY].size ; break
-#define CASE_ARRAY_TYPE(enum_name,array,dest,gl_type) \
- case GL_ ## enum_name ## _ARRAY_TYPE: \
- *dest = (gl_type) state->vertArray.arrays[array ## _ARRAY].type ; break
-#define CASE_ARRAY_STRIDE(enum_name,array,dest,gl_type) \
- case GL_ ## enum_name ## _ARRAY_STRIDE: \
- *dest = (gl_type) state->vertArray.arrays[array ## _ARRAY].stride ; break
-
-#define CASE_ARRAY_ALL(enum_name,array,dest,gl_type) \
- CASE_ARRAY_ENABLE(enum_name,array,dest,gl_type); \
- CASE_ARRAY_STRIDE(enum_name,array,dest,gl_type); \
- CASE_ARRAY_TYPE(enum_name,array,dest,gl_type); \
- CASE_ARRAY_SIZE(enum_name,array,dest,gl_type)
+
+/**
+ * Get the selected attribute from the vertex array state vector.
+ *
+ * \returns
+ * On success \c GL_TRUE is returned. Otherwise, \c GL_FALSE is returned.
+ */
+static GLboolean
+get_array_data( __GLXattribute * state, GLenum cap, GLintptr * data )
+{
+ GLboolean retval = GL_FALSE;
+ const GLint tex_unit = __glXGetActiveTextureUnit( state );
+
+
+ switch( cap ) {
+ case GL_VERTEX_ARRAY:
+ case GL_NORMAL_ARRAY:
+ case GL_COLOR_ARRAY:
+ case GL_INDEX_ARRAY:
+ case GL_EDGE_FLAG_ARRAY:
+ case GL_SECONDARY_COLOR_ARRAY:
+ case GL_FOG_COORD_ARRAY:
+ retval = __glXGetArrayEnable( state, cap, 0, data );
+ break;
+
+ case GL_VERTEX_ARRAY_SIZE:
+ retval = __glXGetArraySize( state, GL_VERTEX_ARRAY, 0, data );
+ break;
+ case GL_COLOR_ARRAY_SIZE:
+ retval = __glXGetArraySize( state, GL_COLOR_ARRAY, 0, data );
+ break;
+ case GL_SECONDARY_COLOR_ARRAY_SIZE:
+ retval = __glXGetArraySize( state, GL_SECONDARY_COLOR_ARRAY, 0, data );
+ break;
+
+ case GL_VERTEX_ARRAY_TYPE:
+ retval = __glXGetArrayType( state, GL_VERTEX_ARRAY, 0, data );
+ break;
+ case GL_NORMAL_ARRAY_TYPE:
+ retval = __glXGetArrayType( state, GL_NORMAL_ARRAY, 0, data );
+ break;
+ case GL_INDEX_ARRAY_TYPE:
+ retval = __glXGetArrayType( state, GL_INDEX_ARRAY, 0, data );
+ break;
+ case GL_COLOR_ARRAY_TYPE:
+ retval = __glXGetArrayType( state, GL_COLOR_ARRAY, 0, data );
+ break;
+ case GL_SECONDARY_COLOR_ARRAY_TYPE:
+ retval = __glXGetArrayType( state, GL_SECONDARY_COLOR_ARRAY, 0, data );
+ break;
+ case GL_FOG_COORD_ARRAY_TYPE:
+ retval = __glXGetArrayType( state, GL_FOG_COORD_ARRAY, 0, data );
+ break;
+
+ case GL_VERTEX_ARRAY_STRIDE:
+ retval = __glXGetArrayStride( state, GL_VERTEX_ARRAY, 0, data );
+ break;
+ case GL_NORMAL_ARRAY_STRIDE:
+ retval = __glXGetArrayStride( state, GL_NORMAL_ARRAY, 0, data );
+ break;
+ case GL_INDEX_ARRAY_STRIDE:
+ retval = __glXGetArrayStride( state, GL_INDEX_ARRAY, 0, data );
+ break;
+ case GL_EDGE_FLAG_ARRAY_STRIDE:
+ retval = __glXGetArrayStride( state, GL_EDGE_FLAG_ARRAY, 0, data );
+ break;
+ case GL_COLOR_ARRAY_STRIDE:
+ retval = __glXGetArrayStride( state, GL_COLOR_ARRAY, 0, data );
+ break;
+ case GL_SECONDARY_COLOR_ARRAY_STRIDE:
+ retval = __glXGetArrayStride( state, GL_SECONDARY_COLOR_ARRAY, 0, data );
+ break;
+ case GL_FOG_COORD_ARRAY_STRIDE:
+ retval = __glXGetArrayStride( state, GL_FOG_COORD_ARRAY, 0, data );
+ break;
+
+ case GL_TEXTURE_COORD_ARRAY:
+ retval = __glXGetArrayEnable( state, GL_TEXTURE_COORD_ARRAY, tex_unit, data );
+ break;
+ case GL_TEXTURE_COORD_ARRAY_SIZE:
+ retval = __glXGetArraySize( state, GL_TEXTURE_COORD_ARRAY, tex_unit, data );
+ break;
+ case GL_TEXTURE_COORD_ARRAY_TYPE:
+ retval = __glXGetArrayType( state, GL_TEXTURE_COORD_ARRAY, tex_unit, data );
+ break;
+ case GL_TEXTURE_COORD_ARRAY_STRIDE:
+ retval = __glXGetArrayStride( state, GL_TEXTURE_COORD_ARRAY, tex_unit, data );
+ break;
+
+ case GL_MAX_ELEMENTS_VERTICES:
+ case GL_MAX_ELEMENTS_INDICES:
+ retval = GL_TRUE;
+ *data = ~0UL;
+ break;
+ }
+
+
+ return retval;
+}
+
void __indirect_glGetBooleanv(GLenum val, GLboolean *b)
{
@@ -173,6 +257,8 @@ void __indirect_glGetBooleanv(GLenum val, GLboolean *b)
** Error occured; don't modify user's buffer.
*/
} else {
+ GLintptr data;
+
/*
** For all the queries listed here, we use the locally stored
** values rather than the one returned by the server. Note that
@@ -180,6 +266,12 @@ void __indirect_glGetBooleanv(GLenum val, GLboolean *b)
** find out whether it was legal to make a query (it's illegal,
** for example, to call a query between glBegin() and glEnd()).
*/
+
+ if ( get_array_data( state, val, & data ) ) {
+ *b = (GLboolean) data;
+ return;
+ }
+
switch (val) {
case GL_PACK_ROW_LENGTH:
*b = (GLboolean)state->storePack.rowLength;
@@ -229,52 +321,11 @@ void __indirect_glGetBooleanv(GLenum val, GLboolean *b)
case GL_UNPACK_LSB_FIRST:
*b = (GLboolean)state->storeUnpack.lsbFirst;
break;
-
- CASE_ARRAY_ALL(VERTEX, vertex, b, GLboolean);
-
- CASE_ARRAY_ENABLE(NORMAL, normal, b, GLboolean);
- CASE_ARRAY_TYPE(NORMAL, normal, b, GLboolean);
- CASE_ARRAY_STRIDE(NORMAL, normal, b, GLboolean);
-
- CASE_ARRAY_ALL(COLOR, color, b, GLboolean);
-
- CASE_ARRAY_ENABLE(INDEX, index, b, GLboolean);
- CASE_ARRAY_TYPE(INDEX, index, b, GLboolean);
- CASE_ARRAY_STRIDE(INDEX, index, b, GLboolean);
-
- case GL_TEXTURE_COORD_ARRAY:
- *b = (GLboolean)IS_TEXARRAY_ENABLED(state, state->vertArray.activeTexture);
- break;
- case GL_TEXTURE_COORD_ARRAY_SIZE:
- *b = (GLboolean)state->vertArray.texCoord[state->vertArray.activeTexture].size;
- break;
- case GL_TEXTURE_COORD_ARRAY_TYPE:
- *b = (GLboolean)state->vertArray.texCoord[state->vertArray.activeTexture].type;
- break;
- case GL_TEXTURE_COORD_ARRAY_STRIDE:
- *b = (GLboolean)state->vertArray.texCoord[state->vertArray.activeTexture].stride;
- break;
-
- CASE_ARRAY_ENABLE(EDGE_FLAG, edgeFlag, b, GLboolean);
- CASE_ARRAY_STRIDE(EDGE_FLAG, edgeFlag, b, GLboolean);
-
- CASE_ARRAY_ALL(SECONDARY_COLOR, secondaryColor, b, GLboolean);
-
- CASE_ARRAY_ENABLE(FOG_COORD, fogCoord, b, GLboolean);
- CASE_ARRAY_TYPE(FOG_COORD, fogCoord, b, GLboolean);
- CASE_ARRAY_STRIDE(FOG_COORD, fogCoord, b, GLboolean);
-
- case GL_MAX_ELEMENTS_VERTICES:
- *b = (GLboolean)state->vertArray.maxElementsVertices;
- break;
- case GL_MAX_ELEMENTS_INDICES:
- *b = (GLboolean)state->vertArray.maxElementsIndices;
- break;
case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH:
*b = (GLboolean)__GL_CLIENT_ATTRIB_STACK_DEPTH;
break;
- case GL_CLIENT_ACTIVE_TEXTURE_ARB:
- *b = (GLboolean)(state->vertArray.activeTexture + GL_TEXTURE0_ARB);
+ case GL_CLIENT_ACTIVE_TEXTURE:
+ *b = (GLboolean)(__glXGetActiveTextureUnit(state) + GL_TEXTURE0);
break;
default:
/*
@@ -314,6 +365,8 @@ void __indirect_glGetDoublev(GLenum val, GLdouble *d)
** Error occured; don't modify user's buffer.
*/
} else {
+ GLintptr data;
+
/*
** For all the queries listed here, we use the locally stored
** values rather than the one returned by the server. Note that
@@ -321,6 +374,12 @@ void __indirect_glGetDoublev(GLenum val, GLdouble *d)
** find out whether it was legal to make a query (it's illegal,
** for example, to call a query between glBegin() and glEnd()).
*/
+
+ if ( get_array_data( state, val, & data ) ) {
+ *d = (GLdouble) data;
+ return;
+ }
+
switch (val) {
case GL_PACK_ROW_LENGTH:
*d = (GLdouble)state->storePack.rowLength;
@@ -370,52 +429,11 @@ void __indirect_glGetDoublev(GLenum val, GLdouble *d)
case GL_UNPACK_LSB_FIRST:
*d = (GLdouble)state->storeUnpack.lsbFirst;
break;
-
- CASE_ARRAY_ALL(VERTEX, vertex, d, GLdouble);
-
- CASE_ARRAY_ENABLE(NORMAL, normal, d, GLdouble);
- CASE_ARRAY_TYPE(NORMAL, normal, d, GLdouble);
- CASE_ARRAY_STRIDE(NORMAL, normal, d, GLdouble);
-
- CASE_ARRAY_ALL(COLOR, color, d, GLdouble);
-
- CASE_ARRAY_ENABLE(INDEX, index, d, GLdouble);
- CASE_ARRAY_TYPE(INDEX, index, d, GLdouble);
- CASE_ARRAY_STRIDE(INDEX, index, d, GLdouble);
-
- case GL_TEXTURE_COORD_ARRAY:
- *d = (GLdouble) IS_TEXARRAY_ENABLED(state, state->vertArray.activeTexture);
- break;
- case GL_TEXTURE_COORD_ARRAY_SIZE:
- *d = (GLdouble)state->vertArray.texCoord[state->vertArray.activeTexture].size;
- break;
- case GL_TEXTURE_COORD_ARRAY_TYPE:
- *d = (GLdouble)state->vertArray.texCoord[state->vertArray.activeTexture].type;
- break;
- case GL_TEXTURE_COORD_ARRAY_STRIDE:
- *d = (GLdouble)state->vertArray.texCoord[state->vertArray.activeTexture].stride;
- break;
-
- CASE_ARRAY_ENABLE(EDGE_FLAG, edgeFlag, d, GLdouble);
- CASE_ARRAY_STRIDE(EDGE_FLAG, edgeFlag, d, GLdouble);
-
- CASE_ARRAY_ALL(SECONDARY_COLOR, secondaryColor, d, GLdouble);
-
- CASE_ARRAY_ENABLE(FOG_COORD, fogCoord, d, GLdouble);
- CASE_ARRAY_TYPE(FOG_COORD, fogCoord, d, GLdouble);
- CASE_ARRAY_STRIDE(FOG_COORD, fogCoord, d, GLdouble);
-
- case GL_MAX_ELEMENTS_VERTICES:
- *d = (GLdouble)state->vertArray.maxElementsVertices;
- break;
- case GL_MAX_ELEMENTS_INDICES:
- *d = (GLdouble)state->vertArray.maxElementsIndices;
- break;
case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH:
*d = (GLdouble)__GL_CLIENT_ATTRIB_STACK_DEPTH;
break;
- case GL_CLIENT_ACTIVE_TEXTURE_ARB:
- *d = (GLdouble)(state->vertArray.activeTexture + GL_TEXTURE0_ARB);
+ case GL_CLIENT_ACTIVE_TEXTURE:
+ *d = (GLdouble)(__glXGetActiveTextureUnit(state) + GL_TEXTURE0);
break;
default:
/*
@@ -455,6 +473,8 @@ void __indirect_glGetFloatv(GLenum val, GLfloat *f)
** Error occured; don't modify user's buffer.
*/
} else {
+ GLintptr data;
+
/*
** For all the queries listed here, we use the locally stored
** values rather than the one returned by the server. Note that
@@ -462,6 +482,12 @@ void __indirect_glGetFloatv(GLenum val, GLfloat *f)
** find out whether it was legal to make a query (it's illegal,
** for example, to call a query between glBegin() and glEnd()).
*/
+
+ if ( get_array_data( state, val, & data ) ) {
+ *f = (GLfloat) data;
+ return;
+ }
+
switch (val) {
case GL_PACK_ROW_LENGTH:
*f = (GLfloat)state->storePack.rowLength;
@@ -511,52 +537,11 @@ void __indirect_glGetFloatv(GLenum val, GLfloat *f)
case GL_UNPACK_LSB_FIRST:
*f = (GLfloat)state->storeUnpack.lsbFirst;
break;
-
- CASE_ARRAY_ALL(VERTEX, vertex, f, GLfloat);
-
- CASE_ARRAY_ENABLE(NORMAL, normal, f, GLfloat);
- CASE_ARRAY_TYPE(NORMAL, normal, f, GLfloat);
- CASE_ARRAY_STRIDE(NORMAL, normal, f, GLfloat);
-
- CASE_ARRAY_ALL(COLOR, color, f, GLfloat);
-
- CASE_ARRAY_ENABLE(INDEX, index, f, GLfloat);
- CASE_ARRAY_TYPE(INDEX, index, f, GLfloat);
- CASE_ARRAY_STRIDE(INDEX, index, f, GLfloat);
-
- case GL_TEXTURE_COORD_ARRAY:
- *f = (GLfloat) IS_TEXARRAY_ENABLED(state, state->vertArray.activeTexture);
- break;
- case GL_TEXTURE_COORD_ARRAY_SIZE:
- *f = (GLfloat)state->vertArray.texCoord[state->vertArray.activeTexture].size;
- break;
- case GL_TEXTURE_COORD_ARRAY_TYPE:
- *f = (GLfloat)state->vertArray.texCoord[state->vertArray.activeTexture].type;
- break;
- case GL_TEXTURE_COORD_ARRAY_STRIDE:
- *f = (GLfloat)state->vertArray.texCoord[state->vertArray.activeTexture].stride;
- break;
-
- CASE_ARRAY_ENABLE(EDGE_FLAG, edgeFlag, f, GLfloat);
- CASE_ARRAY_STRIDE(EDGE_FLAG, edgeFlag, f, GLfloat);
-
- CASE_ARRAY_ALL(SECONDARY_COLOR, secondaryColor, f, GLfloat);
-
- CASE_ARRAY_ENABLE(FOG_COORD, fogCoord, f, GLfloat);
- CASE_ARRAY_TYPE(FOG_COORD, fogCoord, f, GLfloat);
- CASE_ARRAY_STRIDE(FOG_COORD, fogCoord, f, GLfloat);
-
- case GL_MAX_ELEMENTS_VERTICES:
- *f = (GLfloat)state->vertArray.maxElementsVertices;
- break;
- case GL_MAX_ELEMENTS_INDICES:
- *f = (GLfloat)state->vertArray.maxElementsIndices;
- break;
case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH:
*f = (GLfloat)__GL_CLIENT_ATTRIB_STACK_DEPTH;
break;
- case GL_CLIENT_ACTIVE_TEXTURE_ARB:
- *f = (GLfloat)(state->vertArray.activeTexture + GL_TEXTURE0_ARB);
+ case GL_CLIENT_ACTIVE_TEXTURE:
+ *f = (GLfloat)(__glXGetActiveTextureUnit(state) + GL_TEXTURE0);
break;
default:
/*
@@ -596,6 +581,8 @@ void __indirect_glGetIntegerv(GLenum val, GLint *i)
** Error occured; don't modify user's buffer.
*/
} else {
+ GLintptr data;
+
/*
** For all the queries listed here, we use the locally stored
** values rather than the one returned by the server. Note that
@@ -603,6 +590,12 @@ void __indirect_glGetIntegerv(GLenum val, GLint *i)
** find out whether it was legal to make a query (it's illegal,
** for example, to call a query between glBegin() and glEnd()).
*/
+
+ if ( get_array_data( state, val, & data ) ) {
+ *i = (GLint) data;
+ return;
+ }
+
switch (val) {
case GL_PACK_ROW_LENGTH:
*i = (GLint)state->storePack.rowLength;
@@ -652,52 +645,11 @@ void __indirect_glGetIntegerv(GLenum val, GLint *i)
case GL_UNPACK_LSB_FIRST:
*i = (GLint)state->storeUnpack.lsbFirst;
break;
-
- CASE_ARRAY_ALL(VERTEX, vertex, i, GLint);
-
- CASE_ARRAY_ENABLE(NORMAL, normal, i, GLint);
- CASE_ARRAY_TYPE(NORMAL, normal, i, GLint);
- CASE_ARRAY_STRIDE(NORMAL, normal, i, GLint);
-
- CASE_ARRAY_ALL(COLOR, color, i, GLint);
-
- CASE_ARRAY_ENABLE(INDEX, index, i, GLint);
- CASE_ARRAY_TYPE(INDEX, index, i, GLint);
- CASE_ARRAY_STRIDE(INDEX, index, i, GLint);
-
- case GL_TEXTURE_COORD_ARRAY:
- *i = (GLint) IS_TEXARRAY_ENABLED(state, state->vertArray.activeTexture);
- break;
- case GL_TEXTURE_COORD_ARRAY_SIZE:
- *i = (GLint)state->vertArray.texCoord[state->vertArray.activeTexture].size;
- break;
- case GL_TEXTURE_COORD_ARRAY_TYPE:
- *i = (GLint)state->vertArray.texCoord[state->vertArray.activeTexture].type;
- break;
- case GL_TEXTURE_COORD_ARRAY_STRIDE:
- *i = (GLint)state->vertArray.texCoord[state->vertArray.activeTexture].stride;
- break;
-
- CASE_ARRAY_ENABLE(EDGE_FLAG, edgeFlag, i, GLint);
- CASE_ARRAY_STRIDE(EDGE_FLAG, edgeFlag, i, GLint);
-
- CASE_ARRAY_ALL(SECONDARY_COLOR, secondaryColor, i, GLint);
-
- CASE_ARRAY_ENABLE(FOG_COORD, fogCoord, i, GLint);
- CASE_ARRAY_TYPE(FOG_COORD, fogCoord, i, GLint);
- CASE_ARRAY_STRIDE(FOG_COORD, fogCoord, i, GLint);
-
- case GL_MAX_ELEMENTS_VERTICES:
- *i = (GLint)state->vertArray.maxElementsVertices;
- break;
- case GL_MAX_ELEMENTS_INDICES:
- *i = (GLint)state->vertArray.maxElementsIndices;
- break;
case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH:
*i = (GLint)__GL_CLIENT_ATTRIB_STACK_DEPTH;
break;
- case GL_CLIENT_ACTIVE_TEXTURE_ARB:
- *i = (GLint)(state->vertArray.activeTexture + GL_TEXTURE0_ARB);
+ case GL_CLIENT_ACTIVE_TEXTURE:
+ *i = (GLint)(__glXGetActiveTextureUnit(state) + GL_TEXTURE0);
break;
default:
/*
@@ -981,26 +933,28 @@ GLboolean __indirect_glIsEnabled(GLenum cap)
__GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
xGLXSingleReply reply;
GLboolean retval = 0;
+ GLintptr enable;
if (!dpy) return 0;
switch(cap) {
- case GL_VERTEX_ARRAY:
- return IS_ARRAY_ENABLED(state, vertex);
- case GL_NORMAL_ARRAY:
- return IS_ARRAY_ENABLED(state, normal);
- case GL_COLOR_ARRAY:
- return IS_ARRAY_ENABLED(state, color);
- case GL_INDEX_ARRAY:
- return IS_ARRAY_ENABLED(state, index);
- case GL_TEXTURE_COORD_ARRAY:
- return IS_TEXARRAY_ENABLED(state, state->vertArray.activeTexture);
- case GL_EDGE_FLAG_ARRAY:
- return IS_ARRAY_ENABLED(state, edgeFlag);
- case GL_SECONDARY_COLOR_ARRAY:
- return IS_ARRAY_ENABLED(state, secondaryColor);
- case GL_FOG_COORD_ARRAY:
- return IS_ARRAY_ENABLED(state, fogCoord);
+ case GL_VERTEX_ARRAY:
+ case GL_NORMAL_ARRAY:
+ case GL_COLOR_ARRAY:
+ case GL_INDEX_ARRAY:
+ case GL_EDGE_FLAG_ARRAY:
+ case GL_SECONDARY_COLOR_ARRAY:
+ case GL_FOG_COORD_ARRAY:
+ retval = __glXGetArrayEnable( state, cap, 0, & enable );
+ assert( retval );
+ return (GLboolean) enable;
+ break;
+ case GL_TEXTURE_COORD_ARRAY:
+ retval = __glXGetArrayEnable( state, GL_TEXTURE_COORD_ARRAY,
+ __glXGetActiveTextureUnit( state ), & enable );
+ assert( retval );
+ return (GLboolean) enable;
+ break;
}
__GLX_SINGLE_LOAD_VARIABLES();
@@ -1021,37 +975,32 @@ void __indirect_glGetPointerv(GLenum pname, void **params)
if (!dpy) return;
switch(pname) {
- case GL_VERTEX_ARRAY_POINTER:
- *params = (void *)state->vertArray.arrays[ vertex_ARRAY ].ptr;
- return;
- case GL_NORMAL_ARRAY_POINTER:
- *params = (void *)state->vertArray.arrays[ normal_ARRAY ].ptr;
- return;
- case GL_COLOR_ARRAY_POINTER:
- *params = (void *)state->vertArray.arrays[ color_ARRAY ].ptr;
- return;
- case GL_INDEX_ARRAY_POINTER:
- *params = (void *)state->vertArray.arrays[ index_ARRAY ].ptr;
- return;
- case GL_TEXTURE_COORD_ARRAY_POINTER:
- *params = (void *)state->vertArray.texCoord[state->vertArray.activeTexture].ptr;
- return;
- case GL_EDGE_FLAG_ARRAY_POINTER:
- *params = (void *)state->vertArray.arrays[ edgeFlag_ARRAY ].ptr;
+ 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_SECONDARY_COLOR_ARRAY_POINTER:
- *params = (void *)state->vertArray.arrays[ secondaryColor_ARRAY ].ptr;
+ case GL_TEXTURE_COORD_ARRAY_POINTER:
+ __glXGetArrayPointer( state, GL_TEXTURE_COORD_ARRAY,
+ __glXGetActiveTextureUnit( state ), params );
return;
- case GL_FOG_COORD_ARRAY_POINTER:
- *params = (void *)state->vertArray.arrays[ fogCoord_ARRAY ].ptr;
+ 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:
+ case GL_FEEDBACK_BUFFER_POINTER:
*params = (void *)gc->feedbackBuf;
return;
- case GL_SELECTION_BUFFER_POINTER:
+ case GL_SELECTION_BUFFER_POINTER:
*params = (void *)gc->selectBuf;
return;
- default:
+ default:
__glXSetError(gc, GL_INVALID_ENUM);
return;
}