[Xorg-commit] xc/lib/GL/glx clientattrib.c,1.1,1.1.4.1 compsize.c,1.1.4.1,1.1.4.2 g_render.c,1.1.4.1,1.1.4.2 glxclient.h,1.1.4.2,1.1.4.3 glxcmds.c,1.1.4.2,1.1.4.3 glxext.c,1.1.4.2,1.1.4.3 glxextensions.c,1.1,1.1.4.1 indirect.h,1.1.4.1,1.1.4.2 indirect_init.c,1.1.4.1,1.1.4.2 indirect_wrap.h,1.1.4.1,1.1.4.2 pixel.c,1.1.4.1,1.1.4.2 pixelstore.c,1.1,1.1.4.1 render2.c,1.1.4.1,1.1.4.2 single2.c,1.1.4.1,1.1.4.2 singlepix.c,1.1,1.1.4.1 size.h,1.1.4.1,1.1.4.2 vertarr.c,1.1,1.1.4.1
Kaleb Keithley
xorg-commit at pdx.freedesktop.org
Wed May 9 17:30:30 EEST 2007
Committed by: kaleb
Update of /cvs/xorg/xc/lib/GL/glx
In directory pdx:/home/kaleb/xorg/xc.XORG-CURRENT/lib/GL/glx
Modified Files:
Tag: XORG-CURRENT
clientattrib.c compsize.c g_render.c glxclient.h glxcmds.c
glxext.c glxextensions.c indirect.h indirect_init.c
indirect_wrap.h pixel.c pixelstore.c render2.c single2.c
singlepix.c size.h vertarr.c
Log Message:
merge most of XFree86 RC3 (4.3.99.903) from vendor branch.
bug #214
Index: clientattrib.c
===================================================================
RCS file: /cvs/xorg/xc/lib/GL/glx/clientattrib.c,v
retrieving revision 1.1
retrieving revision 1.1.4.1
diff -u -d -r1.1 -r1.1.4.1
--- a/clientattrib.c 14 Nov 2003 16:48:44 -0000 1.1
+++ b/clientattrib.c 23 Feb 2004 21:33:57 -0000 1.1.4.1
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/glx/clientattrib.c,v 1.5 2001/03/21 16:04:39 dawes Exp $ */
+/* $XFree86: xc/lib/GL/glx/clientattrib.c,v 1.6 2004/01/28 18:11:38 alanh Exp $ */
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
@@ -43,25 +43,32 @@
void glEnableClientState(GLenum array)
{
__GLXcontext *gc = __glXGetCurrentContext();
+ __GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
switch (array) {
case GL_COLOR_ARRAY:
- gc->state.vertArray.color.enable = GL_TRUE;
+ state->vertArray.color.enable = GL_TRUE;
break;
case GL_EDGE_FLAG_ARRAY:
- gc->state.vertArray.edgeFlag.enable = GL_TRUE;
+ state->vertArray.edgeFlag.enable = GL_TRUE;
break;
case GL_INDEX_ARRAY:
- gc->state.vertArray.index.enable = GL_TRUE;
+ state->vertArray.index.enable = GL_TRUE;
break;
case GL_NORMAL_ARRAY:
- gc->state.vertArray.normal.enable = GL_TRUE;
+ state->vertArray.normal.enable = GL_TRUE;
break;
case GL_TEXTURE_COORD_ARRAY:
- gc->state.vertArray.texCoord[gc->state.vertArray.activeTexture].enable = GL_TRUE;
+ state->vertArray.texCoord[state->vertArray.activeTexture].enable = GL_TRUE;
break;
case GL_VERTEX_ARRAY:
- gc->state.vertArray.vertex.enable = GL_TRUE;
+ state->vertArray.vertex.enable = GL_TRUE;
+ break;
+ case GL_SECONDARY_COLOR_ARRAY:
+ state->vertArray.secondaryColor.enable = GL_TRUE;
+ break;
+ case GL_FOG_COORDINATE_ARRAY:
+ state->vertArray.fogCoord.enable = GL_TRUE;
break;
default:
__glXSetError(gc, GL_INVALID_ENUM);
@@ -71,25 +78,32 @@
void glDisableClientState(GLenum array)
{
__GLXcontext *gc = __glXGetCurrentContext();
+ __GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
switch (array) {
case GL_COLOR_ARRAY:
- gc->state.vertArray.color.enable = GL_FALSE;
+ state->vertArray.color.enable = GL_FALSE;
break;
case GL_EDGE_FLAG_ARRAY:
- gc->state.vertArray.edgeFlag.enable = GL_FALSE;
+ state->vertArray.edgeFlag.enable = GL_FALSE;
break;
case GL_INDEX_ARRAY:
- gc->state.vertArray.index.enable = GL_FALSE;
+ state->vertArray.index.enable = GL_FALSE;
break;
case GL_NORMAL_ARRAY:
- gc->state.vertArray.normal.enable = GL_FALSE;
+ state->vertArray.normal.enable = GL_FALSE;
break;
case GL_TEXTURE_COORD_ARRAY:
- gc->state.vertArray.texCoord[gc->state.vertArray.activeTexture].enable = GL_FALSE;
+ state->vertArray.texCoord[state->vertArray.activeTexture].enable = GL_FALSE;
break;
case GL_VERTEX_ARRAY:
- gc->state.vertArray.vertex.enable = GL_FALSE;
+ state->vertArray.vertex.enable = GL_FALSE;
+ break;
+ case GL_SECONDARY_COLOR_ARRAY:
+ state->vertArray.secondaryColor.enable = GL_FALSE;
+ break;
+ case GL_FOG_COORDINATE_ARRAY:
+ state->vertArray.fogCoord.enable = GL_FALSE;
break;
default:
__glXSetError(gc, GL_INVALID_ENUM);
@@ -101,6 +115,7 @@
void glPushClientAttrib(GLuint mask)
{
__GLXcontext *gc = __glXGetCurrentContext();
+ __GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
__GLXattribute **spp = gc->attributes.stackPointer, *sp;
if (spp < &gc->attributes.stack[__GL_CLIENT_ATTRIB_STACK_DEPTH]) {
@@ -111,11 +126,11 @@
sp->mask = mask;
gc->attributes.stackPointer = spp + 1;
if (mask & GL_CLIENT_PIXEL_STORE_BIT) {
- sp->storePack = gc->state.storePack;
- sp->storeUnpack = gc->state.storeUnpack;
+ sp->storePack = state->storePack;
+ sp->storeUnpack = state->storeUnpack;
}
if (mask & GL_CLIENT_VERTEX_ARRAY_BIT) {
- sp->vertArray = gc->state.vertArray;
+ sp->vertArray = state->vertArray;
}
} else {
__glXSetError(gc, GL_STACK_OVERFLOW);
@@ -126,6 +141,7 @@
void glPopClientAttrib(void)
{
__GLXcontext *gc = __glXGetCurrentContext();
+ __GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
__GLXattribute **spp = gc->attributes.stackPointer, *sp;
GLuint mask;
@@ -137,11 +153,11 @@
gc->attributes.stackPointer = spp;
if (mask & GL_CLIENT_PIXEL_STORE_BIT) {
- gc->state.storePack = sp->storePack;
- gc->state.storeUnpack = sp->storeUnpack;
+ state->storePack = sp->storePack;
+ state->storeUnpack = sp->storeUnpack;
}
if (mask & GL_CLIENT_VERTEX_ARRAY_BIT) {
- gc->state.vertArray = sp->vertArray;
+ state->vertArray = sp->vertArray;
}
sp->mask = 0;
Index: compsize.c
===================================================================
RCS file: /cvs/xorg/xc/lib/GL/glx/compsize.c,v
retrieving revision 1.1.4.1
retrieving revision 1.1.4.2
diff -u -d -r1.1.4.1 -r1.1.4.2
--- a/compsize.c 26 Nov 2003 22:48:31 -0000 1.1.4.1
+++ b/compsize.c 23 Feb 2004 21:33:57 -0000 1.1.4.2
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/glx/compsize.c,v 1.5 2003/09/28 20:15:01 alanh Exp $ */
+/* $XFree86: xc/lib/GL/glx/compsize.c,v 1.7 2004/01/28 21:18:48 alanh Exp $ */
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
@@ -35,7 +35,7 @@
*/
#include <GL/gl.h>
-
+#include "glxclient.h"
#include "size.h"
/*
@@ -80,6 +80,7 @@
case GL_422_REV_EXT:
case GL_422_AVERAGE_EXT:
case GL_422_REV_AVERAGE_EXT:
+ case GL_YCBCR_422_APPLE:
case GL_LUMINANCE_ALPHA:
return 2;
case GL_RGBA:
@@ -250,9 +251,6 @@
GLint __glTexParameterfv_size(GLenum e)
{
switch (e) {
- case GL_TEXTURE_BORDER_COLOR:
- return 4;
-
case GL_TEXTURE_WRAP_S:
case GL_TEXTURE_WRAP_T:
case GL_TEXTURE_WRAP_R:
@@ -276,6 +274,15 @@
case GL_TEXTURE_COMPARE_MODE:
case GL_TEXTURE_COMPARE_FUNC:
+ /* GL_SGIS_generate_mipmap / GL 1.4 */
+ case GL_GENERATE_MIPMAP:
+
+ /* GL_ARB_depth_texture / GL 1.4 */
+ case GL_DEPTH_TEXTURE_MODE:
+
+ /* GL_EXT_texture_lod_bias / GL 1.4 */
+ case GL_TEXTURE_LOD_BIAS:
+
/* GL_SGIX_shadow_ambient / GL_ARB_shadow_ambient */
case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB:
@@ -287,7 +294,25 @@
case GL_TEXTURE_MAX_CLAMP_S_SGIX:
case GL_TEXTURE_MAX_CLAMP_T_SGIX:
case GL_TEXTURE_MAX_CLAMP_R_SGIX:
- return 1;
+
+ /* GL_EXT_texture_filter_anisotropic */
+ case GL_TEXTURE_MAX_ANISOTROPY_EXT:
+
+ /* GL_SGIX_clipmap */
+ case GL_TEXTURE_CLIPMAP_CENTER_SGIX:
+ case GL_TEXTURE_CLIPMAP_OFFSET_SGIX:
+ return 2;
+
+ /* GL_SGIX_clipmap */
+ case GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX:
+ return 3;
+
+ case GL_TEXTURE_BORDER_COLOR:
+
+ /* GL_SGIX_texture_scale_bias */
+ case GL_POST_TEXTURE_FILTER_BIAS_SGIX:
+ case GL_POST_TEXTURE_FILTER_SCALE_SGIX:
+ return 4;
default:
return 0;
@@ -303,29 +328,41 @@
{
switch (e) {
case GL_TEXTURE_ENV_MODE:
- return 1;
- case GL_TEXTURE_ENV_COLOR:
- return 4;
- /* GL_EXT_texture_env_combine */
- case GL_COMBINE_RGB_EXT:
- case GL_COMBINE_ALPHA_EXT:
- case GL_SOURCE0_RGB_EXT:
- case GL_SOURCE1_RGB_EXT:
- case GL_SOURCE2_RGB_EXT:
- case GL_SOURCE0_ALPHA_EXT:
- case GL_SOURCE1_ALPHA_EXT:
- case GL_SOURCE2_ALPHA_EXT:
- case GL_OPERAND0_RGB_EXT:
- case GL_OPERAND1_RGB_EXT:
- case GL_OPERAND0_ALPHA_EXT:
- case GL_OPERAND1_ALPHA_EXT:
- case GL_OPERAND2_RGB_EXT:
- case GL_OPERAND2_ALPHA_EXT:
- case GL_RGB_SCALE_EXT:
+
+ /* GL_ARB_texture_env_combine / GL_EXT_texture_env_combine / GL 1.3 */
+ case GL_COMBINE_RGB:
+ case GL_COMBINE_ALPHA:
+ case GL_SOURCE0_RGB:
+ case GL_SOURCE1_RGB:
+ case GL_SOURCE2_RGB:
+ case GL_SOURCE0_ALPHA:
+ case GL_SOURCE1_ALPHA:
+ case GL_SOURCE2_ALPHA:
+ case GL_OPERAND0_RGB:
+ case GL_OPERAND1_RGB:
+ case GL_OPERAND0_ALPHA:
+ case GL_OPERAND1_ALPHA:
+ case GL_OPERAND2_RGB:
+ case GL_OPERAND2_ALPHA:
+ case GL_RGB_SCALE:
case GL_ALPHA_SCALE:
- /* GL_EXT_texture_lod_bias */
- case GL_TEXTURE_LOD_BIAS_EXT:
+
+ /* GL_EXT_texture_lod_bias / GL 1.4 */
+ case GL_TEXTURE_LOD_BIAS:
+
+ /* GL_ARB_point_sprite / GL_NV_point_sprite */
+ case GL_COORD_REPLACE_NV:
+
+ /* GL_NV_texture_env_combine4 */
+ case GL_SOURCE3_RGB_NV:
+ case GL_SOURCE3_ALPHA_NV:
+ case GL_OPERAND3_RGB_NV:
+ case GL_OPERAND3_ALPHA_NV:
return 1;
+
+ case GL_TEXTURE_ENV_COLOR:
+ return 4;
+
default:
return 0;
}
@@ -459,14 +496,23 @@
GLint __glPointParameterfvARB_size(GLenum e)
{
switch (e) {
- case GL_POINT_DISTANCE_ATTENUATION_ARB:
- return 3;
- case GL_POINT_SIZE_MIN_ARB:
- case GL_POINT_SIZE_MAX_ARB:
- case GL_POINT_FADE_THRESHOLD_SIZE_ARB:
+ case GL_POINT_SIZE_MIN:
+ case GL_POINT_SIZE_MAX:
+ case GL_POINT_FADE_THRESHOLD_SIZE:
+
+ /* GL_NV_point_sprite */
+ case GL_POINT_SPRITE_R_MODE_NV:
return 1;
+
+ case GL_POINT_DISTANCE_ATTENUATION:
+ return 3;
+
default:
return -1;
}
}
+GLint __glPointParameteriv_size(GLenum e)
+{
+ return __glPointParameterfvARB_size(e);
+}
Index: g_render.c
===================================================================
RCS file: /cvs/xorg/xc/lib/GL/glx/g_render.c,v
retrieving revision 1.1.4.1
retrieving revision 1.1.4.2
diff -u -d -r1.1.4.1 -r1.1.4.2
--- a/g_render.c 26 Nov 2003 22:48:31 -0000 1.1.4.1
+++ b/g_render.c 23 Feb 2004 21:33:57 -0000 1.1.4.2
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/glx/g_render.c,v 1.7 2003/11/14 16:20:55 dawes Exp $ */
+/* $XFree86: xc/lib/GL/glx/g_render.c,v 1.9 2004/02/02 00:01:18 alanh Exp $ */
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
@@ -31,6 +31,190 @@
#include "packrender.h"
#include "size.h"
+#define GLdouble_SIZE 8
+#define GLclampd_SIZE 8
+#define GLfloat_SIZE 4
+#define GLclampf_SIZE 4
+#define GLint_SIZE 4
+#define GLuint_SIZE 4
+#define GLenum_SIZE 4
+#define GLbitfield_SIZE 4
+#define GLshort_SIZE 2
+#define GLushort_SIZE 2
+#define GLbyte_SIZE 1
+#define GLubyte_SIZE 1
+#define GLboolean_SIZE 1
+
+#define __GLX_PUT_GLdouble(offset,value) __GLX_PUT_DOUBLE(offset,value)
+#define __GLX_PUT_GLclampd(offset,value) __GLX_PUT_DOUBLE(offset,value)
+#define __GLX_PUT_GLfloat(offset,value) __GLX_PUT_FLOAT(offset,value)
+#define __GLX_PUT_GLclampf(offset,value) __GLX_PUT_FLOAT(offset,value)
+#define __GLX_PUT_GLint(offset,value) __GLX_PUT_LONG(offset,value)
+#define __GLX_PUT_GLuint(offset,value) __GLX_PUT_LONG(offset,value)
+#define __GLX_PUT_GLenum(offset,value) __GLX_PUT_LONG(offset,value)
+#define __GLX_PUT_GLbitfield(offset,value) __GLX_PUT_LONG(offset,value)
+#define __GLX_PUT_GLshort(offset,value) __GLX_PUT_SHORT(offset,value)
+#define __GLX_PUT_GLushort(offset,value) __GLX_PUT_SHORT(offset,value)
+#define __GLX_PUT_GLbyte(offset,value) __GLX_PUT_CHAR(offset,value)
+#define __GLX_PUT_GLubyte(offset,value) __GLX_PUT_CHAR(offset,value)
+#define __GLX_PUT_GLboolean(offset,value) __GLX_PUT_CHAR(offset,value)
+
+#define __GLX_PUT_GLdouble_ARRAY(offset,ptr,count) __GLX_PUT_DOUBLE_ARRAY(offset,ptr,count)
+#define __GLX_PUT_GLclampd_ARRAY(offset,ptr,count) __GLX_PUT_DOUBLE_ARRAY(offset,ptr,count)
+#define __GLX_PUT_GLfloat_ARRAY(offset,ptr,count) __GLX_PUT_FLOAT_ARRAY(offset,ptr,count)
+#define __GLX_PUT_GLclampf_ARRAY(offset,ptr,count) __GLX_PUT_FLOAT_ARRAY(offset,ptr,count)
+#define __GLX_PUT_GLint_ARRAY(offset,ptr,count) __GLX_PUT_LONG_ARRAY(offset,ptr,count)
+#define __GLX_PUT_GLuint_ARRAY(offset,ptr,count) __GLX_PUT_LONG_ARRAY(offset,ptr,count)
+#define __GLX_PUT_GLenum_ARRAY(offset,ptr,count) __GLX_PUT_LONG_ARRAY(offset,ptr,count)
+#define __GLX_PUT_GLshort_ARRAY(offset,ptr,count) __GLX_PUT_SHORT_ARRAY(offset,ptr,count)
+#define __GLX_PUT_GLushort_ARRAY(offset,ptr,count) __GLX_PUT_SHORT_ARRAY(offset,ptr,count)
+#define __GLX_PUT_GLbyte_ARRAY(offset,ptr,count) __GLX_PUT_CHAR_ARRAY(offset,ptr,count)
+#define __GLX_PUT_GLubyte_ARRAY(offset,ptr,count) __GLX_PUT_CHAR_ARRAY(offset,ptr,count)
+#define __GLX_PUT_GLboolean_ARRAY(offset,ptr,count) __GLX_PUT_CHAR_ARRAY(offset,ptr,count)
+
+#define RENDER_SIZE(t,c) (__GLX_PAD(4 + (t ## _SIZE * c)))
+
+/* GLX protocol templates are named in the following manner. All templates
+ * begin with the string 'glxproto_'. Following is an optional list of
+ * scalar parameters. The scalars are listed as type and number. The most
+ * common being \c enum1 (one scalar enum) and \c enum2 (two scalar enums).
+ *
+ * The final part of the name describes the number of named-type parameters
+ * and how they are passed.
+ * - One or more digits followed by the letter s means
+ * that the specified number of parameters are passed as scalars. The macro
+ * \c glxproto_3s generates a function that takes 3 scalars, such as
+ * \c glVertex3f.
+ * - A capital C follwed by a lower-case v means that a constant
+ * sized vector is passed. Macros of this type take an extra parameter,
+ * which is the size of the vector. The invocation
+ * 'glxproto_Cv(Vertex3fv, X_GLrop_Vertexfv, GLfloat, 3)' would generate the
+ * correct protocol for the \c glVertex3fv function.
+ * - A capital V followed by a lower-case v means that a variable sized
+ * vector is passed. The function generated by these macros will call
+ * a co-function to determine the size of the vector. The name of the
+ * co-function is generated by prepending \c __gl and appending \c _size
+ * to the base name of the function. The invocation
+ * 'glxproto_enum1_Vv(Fogiv, X_GLrop_Fogiv, GLint)' would generate the
+ * correct protocol for the \c glFogiv function.
+ * - One or more digits without a following letter means that a function
+ * taking the specified number of scalar parameters and a function with a
+ * vector parameter of the specified size should be generated. The letter
+ * v is automatically appended to the name of the vector-based function in
+ * this case. The invocation
+ * 'glxproto_3(Vertex3f, X_GLrop_Vertex3fv, GLfloat)' would generate the
+ * correct protocol for both \c glVertex3f and \c glVertex3fv.
+ *
+ * glxproto_void is a special case for functions that take no parameters
+ * (i.e., glEnd).
+ *
+ * An addition form is 'glxvendr_'. This is identical to the other forms
+ * with the exception of taking an additional parameter (to the macro) which
+ * is a vendor string to append to the function name. The invocation
+ * 'glxproto_3(Foo3f, X_GLrop_Foo3fv, GLfloat)' would generate the functions
+ * 'glFoo3fv' and 'glFoo3f', and the invocation
+ * 'glxvendr_3(Foo3f, X_GLrop_Foo3fv, GLfloat, EXT)' would generate the
+ * functions 'glFoo3fvEXT' and 'glFoo3fEXT'.
+ */
+
+#define glxproto_Cv(name, rop, type, count) \
+ void __indirect_gl ## name (const type * v) \
+ { \
+ __GLX_DECLARE_VARIABLES(); \
+ __GLX_LOAD_VARIABLES(); \
+ cmdlen = RENDER_SIZE(type, count); \
+ __GLX_BEGIN(rop, cmdlen); \
+ if (count <= 4) { \
+ __GLX_PUT_ ## type (4 + (0 * type ## _SIZE), v[0]); \
+ if (count > 1) { __GLX_PUT_ ## type (4 + (1 * type ## _SIZE), v[1]); } \
+ if (count > 2) { __GLX_PUT_ ## type (4 + (2 * type ## _SIZE), v[2]); } \
+ if (count > 3) { __GLX_PUT_ ## type (4 + (3 * type ## _SIZE), v[3]); } \
+ } else { \
+ __GLX_PUT_ ## type ## _ARRAY(4, v, count); \
+ } \
+ __GLX_END(cmdlen); \
+ }
+
+#define glxproto_1s(name, rop, type) \
+ void __indirect_gl ## name (type v1) \
+ { \
+ __GLX_DECLARE_VARIABLES(); \
+ __GLX_LOAD_VARIABLES(); \
+ cmdlen = RENDER_SIZE(type, 1); \
+ __GLX_BEGIN(rop, cmdlen); \
+ __GLX_PUT_ ## type (4 + (0 * type ## _SIZE), v1); \
+ __GLX_END(cmdlen); \
+ }
+
+#define glxproto_3s(name, rop, type) \
+ void __indirect_gl ## name (type v1, type v2, type v3) \
+ { \
+ __GLX_DECLARE_VARIABLES(); \
+ __GLX_LOAD_VARIABLES(); \
+ cmdlen = RENDER_SIZE(type, 3); \
+ __GLX_BEGIN(rop, cmdlen); \
+ __GLX_PUT_ ## type (4 + (0 * type ## _SIZE), v1); \
+ __GLX_PUT_ ## type (4 + (1 * type ## _SIZE), v2); \
+ __GLX_PUT_ ## type (4 + (2 * type ## _SIZE), v3); \
+ __GLX_END(cmdlen); \
+ }
+
+#define glxproto_4s(name, rop, type) \
+ void __indirect_gl ## name (type v1, type v2, type v3, type v4) \
+ { \
+ __GLX_DECLARE_VARIABLES(); \
+ __GLX_LOAD_VARIABLES(); \
+ cmdlen = RENDER_SIZE(type, 4); \
+ __GLX_BEGIN(rop, cmdlen); \
+ __GLX_PUT_ ## type (4 + (0 * type ## _SIZE), v1); \
+ __GLX_PUT_ ## type (4 + (1 * type ## _SIZE), v2); \
+ __GLX_PUT_ ## type (4 + (2 * type ## _SIZE), v3); \
+ __GLX_PUT_ ## type (4 + (3 * type ## _SIZE), v4); \
+ __GLX_END(cmdlen); \
+ }
+
+#define glxproto_enum1_1s(name, rop, type) \
+ void __indirect_gl ## name (GLenum e, type v1) \
+ { \
+ __GLX_DECLARE_VARIABLES(); \
+ __GLX_LOAD_VARIABLES(); \
+ cmdlen = 4 + RENDER_SIZE(type, 1); \
+ __GLX_BEGIN(rop, cmdlen); \
+ if (type ## _SIZE == 8) { \
+ __GLX_PUT_ ## type (4 + (0 * type ## _SIZE), v1); \
+ __GLX_PUT_LONG (4 + (1 * type ## _SIZE), e); \
+ } else { \
+ __GLX_PUT_LONG(4, e); \
+ __GLX_PUT_ ## type (8 + (0 * type ## _SIZE), v1); \
+ } \
+ __GLX_END(cmdlen); \
+ }
+
+#define glxproto_enum1_Vv(name, rop, type) \
+ void __indirect_gl ## name (GLenum pname, const type * v) \
+ { \
+ __GLX_DECLARE_VARIABLES(); \
+ __GLX_LOAD_VARIABLES(); \
+ compsize = __gl ## name ## _size(pname); \
+ cmdlen = 4 + RENDER_SIZE(type, compsize); \
+ __GLX_BEGIN(rop, cmdlen); \
+ __GLX_PUT_LONG(4, pname); \
+ __GLX_PUT_ ## type ## _ARRAY(8, v, compsize); \
+ __GLX_END(cmdlen); \
+ }
+
+#define glxproto_1(name, rop, type) \
+ glxproto_1s(name, rop, type) \
+ glxproto_Cv(name ## v, rop, type, 1)
+
+#define glxproto_3(name, rop, type) \
+ glxproto_3s(name, rop, type) \
+ glxproto_Cv(name ## v, rop, type, 3)
+
+#define glxproto_enum1_V(name, rop, type) \
+ glxproto_enum1_1s(name, rop, type) \
+ glxproto_enum1_Vv(name ## v, rop ## v, type)
+
void glCallList(GLuint list)
{
__GLX_DECLARE_VARIABLES();
@@ -426,6 +610,18 @@
__GLX_END(12);
}
+glxproto_1(FogCoordf, X_GLrop_FogCoordfv, GLfloat)
+glxproto_1(FogCoordd, X_GLrop_FogCoorddv, GLdouble)
+
+glxproto_3(SecondaryColor3b, X_GLrop_SecondaryColor3bv, GLbyte)
+glxproto_3(SecondaryColor3s, X_GLrop_SecondaryColor3sv, GLshort)
+glxproto_3(SecondaryColor3i, X_GLrop_SecondaryColor3iv, GLint)
+glxproto_3(SecondaryColor3ub, X_GLrop_SecondaryColor3ubv, GLubyte)
+glxproto_3(SecondaryColor3us, X_GLrop_SecondaryColor3usv, GLushort)
+glxproto_3(SecondaryColor3ui, X_GLrop_SecondaryColor3uiv, GLuint)
+glxproto_3(SecondaryColor3f, X_GLrop_SecondaryColor3fv, GLfloat)
+glxproto_3(SecondaryColor3d, X_GLrop_SecondaryColor3dv, GLdouble)
+
void glEdgeFlag(GLboolean flag)
{
__GLX_DECLARE_VARIABLES();
@@ -2423,6 +2619,8 @@
__GLX_END(12);
}
+glxproto_4s(BlendFuncSeparate, X_GLrop_BlendFuncSeparate, GLenum)
+
void glLogicOp(GLenum opcode)
{
__GLX_DECLARE_VARIABLES();
@@ -3498,6 +3696,8 @@
}
}
+glxproto_enum1_V(PointParameteri, X_GLrop_PointParameteri, GLint)
+
void glWindowPos2dARB(GLdouble x, GLdouble y)
{
glWindowPos3fARB(x, y, 0.0);
Index: glxclient.h
===================================================================
RCS file: /cvs/xorg/xc/lib/GL/glx/glxclient.h,v
retrieving revision 1.1.4.2
retrieving revision 1.1.4.3
diff -u -d -r1.1.4.2 -r1.1.4.3
--- a/glxclient.h 6 Dec 2003 13:22:43 -0000 1.1.4.2
+++ b/glxclient.h 23 Feb 2004 21:33:57 -0000 1.1.4.3
@@ -31,8 +31,7 @@
** published by SGI, but has not been independently verified as being
** compliant with the OpenGL(R) version 1.2.1 Specification.
*/
-/* $XFree86: xc/lib/GL/glx/glxclient.h,v 1.18 2003/11/29 01:31:20 dawes Exp $ */
-/* $XdotOrg$ */
+/* $XFree86: xc/lib/GL/glx/glxclient.h,v 1.22 2004/02/11 20:01:21 dawes Exp $ */
/*
* Direct rendering support added by Precision Insight, Inc.
@@ -52,6 +51,7 @@
#include <GL/glx.h>
#include <string.h>
#include <stdlib.h>
+#include <stdio.h>
#include "GL/glxint.h"
#include "GL/glxproto.h"
#include "GL/internal/glcore.h"
@@ -366,9 +366,55 @@
GLuint alignment;
} __GLXpixelStoreMode;
+/* The next 3 structures are deprecated. Client state is no longer tracked
+ * using them. They only remain to maintain the layout / structure offset of
+ * __GLXcontextRec. In XFree86 5.0 they will be removed altogether.
+ */
+
+typedef struct __GLXvertexArrayPointerStateRecDEPRECATED {
+ GLboolean enable;
+ void (*proc)(const void *);
+ const GLubyte *ptr;
+ GLsizei skip;
+ GLint size;
+ GLenum type;
+ GLsizei stride;
+} __GLXvertexArrayPointerStateDEPRECATED;
+
+typedef struct __GLXvertArrayStateRecDEPRECATED {
+ __GLXvertexArrayPointerStateDEPRECATED vertex;
+ __GLXvertexArrayPointerStateDEPRECATED normal;
+ __GLXvertexArrayPointerStateDEPRECATED color;
+ __GLXvertexArrayPointerStateDEPRECATED index;
+ __GLXvertexArrayPointerStateDEPRECATED texCoord[__GLX_MAX_TEXTURE_UNITS];
+ __GLXvertexArrayPointerStateDEPRECATED edgeFlag;
+ GLint maxElementsVertices;
+ GLint maxElementsIndices;
+ GLint activeTexture;
+} __GLXvertArrayStateDEPRECATED;
+
+typedef struct __GLXattributeRecDEPRECATED {
+ GLuint mask;
+
+ /*
+ ** Pixel storage state. Most of the pixel store mode state is kept
+ ** here and used by the client code to manage the packing and
+ ** unpacking of data sent to/received from the server.
+ */
+ __GLXpixelStoreMode storePack, storeUnpack;
+
+ /*
+ ** Vertex Array storage state. The vertex array component
+ ** state is stored here and is used to manage the packing of
+ ** DrawArrays data sent to the server.
+ */
+ __GLXvertArrayStateDEPRECATED vertArray;
+} __GLXattributeDEPRECATED;
+
typedef struct __GLXvertexArrayPointerStateRec {
GLboolean enable;
void (*proc)(const void *);
+ void (*mtex_proc)(GLenum, const void *);
const GLubyte *ptr;
GLsizei skip;
GLint size;
@@ -380,6 +426,8 @@
__GLXvertexArrayPointerState vertex;
__GLXvertexArrayPointerState normal;
__GLXvertexArrayPointerState color;
+ __GLXvertexArrayPointerState secondaryColor;
+ __GLXvertexArrayPointerState fogCoord;
__GLXvertexArrayPointerState index;
__GLXvertexArrayPointerState texCoord[__GLX_MAX_TEXTURE_UNITS];
__GLXvertexArrayPointerState edgeFlag;
@@ -502,7 +550,7 @@
/*
** Client side attribs.
*/
- __GLXattribute state;
+ __GLXattributeDEPRECATED stateDEPRECATED;
__GLXattributeMachine attributes;
/*
@@ -573,6 +621,15 @@
** context is not current to any drawable.
*/
GLXDrawable currentReadable;
+
+ /**
+ * Pointer to client-state data that is private to libGL. This is only
+ * used for indirect rendering contexts.
+ *
+ * No internal API version change was made for this change. Client-side
+ * drivers should NEVER use this data or even care that it exists.
+ */
+ void * client_state_private;
};
#define __glXSetError(gc,code) \
@@ -615,11 +672,8 @@
** a pointer to the config data for that screen (if the screen supports GL).
*/
typedef struct __GLXscreenConfigsRec {
- __GLcontextModes *configs;
- int numConfigs;
__GLXvisualConfig * old_configs;
int numOldConfigs;
-
const char *serverGLXexts;
char *effectiveGLXexts;
@@ -630,6 +684,9 @@
__DRIscreen driScreen;
#endif
+ /* Avoid breaking binary compatibility and put these here */
+ __GLcontextModes *configs;
+ int numConfigs;
/**
* Per-screen dynamic GLX extension tracking. The \c direct_support
* field only contains enough bits for 64 extensions. Should libGL
@@ -820,6 +877,7 @@
extern char *__glXstrdup(const char *str);
+extern const char __glXGLClientVersion[];
extern const char __glXGLClientExtensions[];
extern char *__glXCombineExtensionStrings( const char *cext_string,
const char *sext_string );
Index: glxcmds.c
===================================================================
RCS file: /cvs/xorg/xc/lib/GL/glx/glxcmds.c,v
retrieving revision 1.1.4.2
retrieving revision 1.1.4.3
diff -u -d -r1.1.4.2 -r1.1.4.3
--- a/glxcmds.c 20 Dec 2003 00:28:21 -0000 1.1.4.2
+++ b/glxcmds.c 23 Feb 2004 21:33:57 -0000 1.1.4.3
@@ -1,5 +1,4 @@
-/* $XdotOrg$ */
-/* $XFree86: xc/lib/GL/glx/glxcmds.c,v 1.28 2003/12/08 00:53:59 alanh Exp $ */
+/* $XFree86: xc/lib/GL/glx/glxcmds.c,v 1.31 2004/02/09 23:46:31 alanh Exp $ */
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
@@ -158,6 +157,12 @@
static const char __glXGLXClientVendorName[] = "SGI";
static const char __glXGLXClientVersion[] = "1.2";
+/**
+ * Textual version of the client-side GL core version. This version is
+ * primarilly determined by what functionality has implemented protocol.
+ */
+const char __glXGLClientVersion[] = "1.2";
+
#ifdef GLX_DIRECT_RENDERING
static void * DriverCreateContextWrapper( __GLXscreenConfigs *psc,
Display *dpy, XVisualInfo *vis, void *shared, __DRIcontext *ctx,
@@ -320,12 +325,23 @@
}
+/**
+ * \todo It should be possible to move the allocate of \c client_state_private
+ * later in the function for direct-rendering contexts. Direct-rendering
+ * contexts don't need to track client state, so they don't need that memory
+ * at all.
+ *
+ * \todo Eliminate \c __glXInitVertexArrayState. Replace it with a new
+ * function called \c __glXAllocateClientState that allocates the memory and
+ * does all the initialization (including the pixel pack / unpack).
+ */
static
GLXContext AllocateGLXContext( Display *dpy )
{
GLXContext gc;
int bufSize;
CARD8 opcode;
+ __GLXattribute *state;
if (!dpy)
return NULL;
@@ -343,6 +359,15 @@
}
memset(gc, 0, sizeof(struct __GLXcontextRec));
+ state = Xmalloc(sizeof(struct __GLXattributeRec));
+ if (state == NULL) {
+ /* Out of memory */
+ Xfree(gc);
+ return NULL;
+ }
+ gc->client_state_private = state;
+ memset(gc->client_state_private, 0, sizeof(struct __GLXattributeRec));
+
/*
** Create a temporary buffer to hold GLX rendering commands. The size
** of the buffer is selected so that the maximum number of GLX rendering
@@ -353,6 +378,7 @@
bufSize = (XMaxRequestSize(dpy) * 4) - sz_xGLXRenderReq;
gc->buf = (GLubyte *) Xmalloc(bufSize);
if (!gc->buf) {
+ Xfree(gc->client_state_private);
Xfree(gc);
return NULL;
}
@@ -361,8 +387,8 @@
/* Fill in the new context */
gc->renderMode = GL_RENDER;
- gc->state.storePack.alignment = 4;
- gc->state.storeUnpack.alignment = 4;
+ state->storePack.alignment = 4;
+ state->storeUnpack.alignment = 4;
__glXInitVertexArrayState(gc);
@@ -535,6 +561,7 @@
if (gc->extensions) XFree((char *) gc->extensions);
__glFreeAttributeState(gc);
XFree((char *) gc->buf);
+ XFree((char *) gc->client_state_private);
XFree((char *) gc);
}
@@ -1095,6 +1122,13 @@
*/
PREFER_SMALLER( visualSelectGroup );
+
+ /* The sort order for the visualRating is GLX_NONE, GLX_SLOW, and
+ * GLX_NON_CONFORMANT_CONFIG. It just so happens that this is the
+ * numerical sort order of the enums (0x8000, 0x8001, and 0x800D).
+ */
+ PREFER_SMALLER( visualRating );
+
PREFER_SMALLER( rgbBits );
if ( ((*a)->doubleBufferMode != (*b)->doubleBufferMode) ) {
Index: glxext.c
===================================================================
RCS file: /cvs/xorg/xc/lib/GL/glx/glxext.c,v
retrieving revision 1.1.4.2
retrieving revision 1.1.4.3
diff -u -d -r1.1.4.2 -r1.1.4.3
--- a/glxext.c 20 Dec 2003 00:28:21 -0000 1.1.4.2
+++ b/glxext.c 23 Feb 2004 21:33:57 -0000 1.1.4.3
@@ -1,5 +1,4 @@
-/* $XdotOrg$ */
-/* $XFree86: xc/lib/GL/glx/glxext.c,v 1.22 2003/12/08 17:35:28 dawes Exp $ */
+/* $XFree86: xc/lib/GL/glx/glxext.c,v 1.23 2004/01/30 20:33:06 alanh Exp $ */
/*
** License Applicability. Except to the extent portions of this file are
@@ -501,7 +500,7 @@
** of the reply. They are in pairs of property type
** and property value.
*/
- config->visualRating = GLX_NONE;
+ config->visualRating = GLX_DONT_CARE;
config->visualSelectGroup = 0;
config->transparentPixel = GLX_NONE;
config->transparentRed = GLX_DONT_CARE;
Index: glxextensions.c
===================================================================
RCS file: /cvs/xorg/xc/lib/GL/glx/glxextensions.c,v
retrieving revision 1.1
retrieving revision 1.1.4.1
diff -u -d -r1.1 -r1.1.4.1
--- a/glxextensions.c 25 Nov 2003 19:28:03 -0000 1.1
+++ b/glxextensions.c 23 Feb 2004 21:33:57 -0000 1.1.4.1
@@ -24,7 +24,7 @@
* Authors:
* Ian Romanick <idr at us.ibm.com>
*/
-/* $XFree86: xc/lib/GL/glx/glxextensions.c,v 1.1 2003/09/28 20:15:03 alanh Exp $ */
+/* $XFree86: xc/lib/GL/glx/glxextensions.c,v 1.2 2004/01/28 21:18:48 alanh Exp $ */
#include "packsingle.h"
#include "glxclient.h"
@@ -58,10 +58,10 @@
*/
unsigned char version_major;
unsigned char version_minor;
- unsigned char client_support:1;
- unsigned char direct_support:1;
- unsigned char client_only:1; /** Is the extension client-side only? */
- unsigned char direct_only:1; /** Is the extension for direct
+ unsigned char client_support;
+ unsigned char direct_support;
+ unsigned char client_only; /** Is the extension client-side only? */
+ unsigned char direct_only; /** Is the extension for direct
* contexts only?
*/
} known_glx_extensions[] = {
Index: indirect.h
===================================================================
RCS file: /cvs/xorg/xc/lib/GL/glx/indirect.h,v
retrieving revision 1.1.4.1
retrieving revision 1.1.4.2
diff -u -d -r1.1.4.1 -r1.1.4.2
--- a/indirect.h 26 Nov 2003 22:48:31 -0000 1.1.4.1
+++ b/indirect.h 23 Feb 2004 21:33:57 -0000 1.1.4.2
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/glx/indirect.h,v 1.5 2003/09/28 20:15:03 alanh Exp $ */
+/* $XFree86: xc/lib/GL/glx/indirect.h,v 1.6 2004/01/28 18:11:41 alanh Exp $ */
/**************************************************************************
Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
@@ -464,6 +464,9 @@
void __indirect_glPointParameterfARB(GLenum pname, GLfloat param);
void __indirect_glPointParameterfvARB(GLenum pname, const GLfloat *params);
+void __indirect_glPointParameteri(GLenum, GLint);
+void __indirect_glPointParameteriv(GLenum, const GLint *);
+
void __indirect_glActiveStencilFaceEXT(GLenum mode);
void __indirect_glWindowPos2dARB(GLdouble x, GLdouble y);
@@ -483,7 +486,39 @@
void __indirect_glWindowPos3ivARB(const GLint * p);
void __indirect_glWindowPos3svARB(const GLshort * p);
+void __indirect_glMultiDrawArrays(GLenum mode, GLint *first, GLsizei *count, GLsizei primcount);
+void __indirect_glMultiDrawElements(GLenum mode, const GLsizei *count, GLenum type, const GLvoid ** indices, GLsizei primcount);
+void __indirect_glBlendFuncSeparate(GLenum, GLenum, GLenum, GLenum);
+
void __indirect_glSampleMaskSGIS( GLfloat value, GLboolean invert );
void __indirect_glSamplePatternSGIS( GLenum pass );
+/* 145. GL_EXT_secondary_color / GL 1.4 */
+
+void __indirect_glSecondaryColorPointer (GLint, GLenum, GLsizei, const GLvoid *);
+void __indirect_glSecondaryColor3b(GLbyte red, GLbyte green, GLbyte blue);
+void __indirect_glSecondaryColor3bv(const GLbyte *v);
+void __indirect_glSecondaryColor3d(GLdouble red, GLdouble green, GLdouble blue);
+void __indirect_glSecondaryColor3dv(const GLdouble *v);
+void __indirect_glSecondaryColor3f(GLfloat red, GLfloat green, GLfloat blue);
+void __indirect_glSecondaryColor3fv(const GLfloat *v);
+void __indirect_glSecondaryColor3i(GLint red, GLint green, GLint blue);
+void __indirect_glSecondaryColor3iv(const GLint *v);
+void __indirect_glSecondaryColor3s(GLshort red, GLshort green, GLshort blue);
+void __indirect_glSecondaryColor3sv(const GLshort *v);
+void __indirect_glSecondaryColor3ub(GLubyte red, GLubyte green, GLubyte blue);
+void __indirect_glSecondaryColor3ubv(const GLubyte *v);
+void __indirect_glSecondaryColor3ui(GLuint red, GLuint green, GLuint blue);
+void __indirect_glSecondaryColor3uiv(const GLuint *v);
+void __indirect_glSecondaryColor3us(GLushort red, GLushort green, GLushort blue);
+void __indirect_glSecondaryColor3usv(const GLushort *v);
+
+/* 149. GL_EXT_fog_coord / GL 1.4 */
+
+void __indirect_glFogCoordPointer (GLenum, GLsizei, const GLvoid *);
+void __indirect_glFogCoordd(GLdouble f);
+void __indirect_glFogCoorddv(const GLdouble *v);
+void __indirect_glFogCoordf(GLfloat f);
+void __indirect_glFogCoordfv(const GLfloat *v);
+
#endif /* _INDIRECT_H_ */
Index: indirect_init.c
===================================================================
RCS file: /cvs/xorg/xc/lib/GL/glx/indirect_init.c,v
retrieving revision 1.1.4.1
retrieving revision 1.1.4.2
diff -u -d -r1.1.4.1 -r1.1.4.2
--- a/indirect_init.c 26 Nov 2003 22:48:31 -0000 1.1.4.1
+++ b/indirect_init.c 23 Feb 2004 21:33:57 -0000 1.1.4.2
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/glx/indirect_init.c,v 1.8 2003/09/28 20:15:03 alanh Exp $ */
+/* $XFree86: xc/lib/GL/glx/indirect_init.c,v 1.10 2004/01/31 09:29:32 alanh Exp $ */
/**************************************************************************
Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
@@ -45,6 +45,53 @@
return 0;
}
+/**
+ * \name Vertex array pointer bridge functions
+ *
+ * When EXT_vertex_array was moved into the core GL spec, the \c count
+ * parameter was lost. This libGL really only wants to implement the GL 1.1
+ * version, but we need to support applications that were written to the old
+ * interface. These bridge functions are part of the glue that makes this
+ * happen.
+ */
+/*@{*/
+static void ColorPointerEXT(GLint size, GLenum type, GLsizei stride,
+ GLsizei count, const GLvoid * pointer )
+{
+ (void) count; __indirect_glColorPointer( size, type, stride, pointer );
+}
+
+static void EdgeFlagPointerEXT(GLsizei stride,
+ GLsizei count, const GLboolean * pointer )
+{
+ (void) count; __indirect_glEdgeFlagPointer( stride, pointer );
+}
+
+static void IndexPointerEXT(GLenum type, GLsizei stride,
+ GLsizei count, const GLvoid * pointer )
+{
+ (void) count; __indirect_glIndexPointer( type, stride, pointer );
+}
+
+static void NormalPointerEXT(GLenum type, GLsizei stride, GLsizei count,
+ const GLvoid * pointer )
+{
+ (void) count; __indirect_glNormalPointer( type, stride, pointer );
+}
+
+static void TexCoordPointerEXT(GLint size, GLenum type, GLsizei stride,
+ GLsizei count, const GLvoid * pointer )
+{
+ (void) count; __indirect_glTexCoordPointer( size, type, stride, pointer );
+}
+
+static void VertexPointerEXT(GLint size, GLenum type, GLsizei stride,
+ GLsizei count, const GLvoid * pointer )
+{
+ (void) count; __indirect_glVertexPointer( size, type, stride, pointer );
+}
+/*@}*/
+
__GLapi *__glXNewIndirectAPI(void)
{
@@ -444,6 +491,10 @@
glAPI->ResetMinmax = __indirect_glResetMinmax;
glAPI->SeparableFilter2D = __indirect_glSeparableFilter2D;
+ /* 1.4 */
+ glAPI->MultiDrawArraysEXT = __indirect_glMultiDrawArrays;
+ glAPI->MultiDrawElementsEXT = __indirect_glMultiDrawElements;
+
/* ARB 1. GL_ARB_multitexture */
glAPI->ActiveTextureARB = __indirect_glActiveTextureARB;
glAPI->ClientActiveTextureARB = __indirect_glClientActiveTextureARB;
@@ -516,6 +567,47 @@
glAPI->SampleMaskSGIS = __indirect_glSampleMaskSGIS;
glAPI->SamplePatternSGIS = __indirect_glSamplePatternSGIS;
+ /* 30. GL_EXT_vertex_array */
+ glAPI->ColorPointerEXT = ColorPointerEXT;
+ glAPI->EdgeFlagPointerEXT = EdgeFlagPointerEXT;
+ glAPI->IndexPointerEXT = IndexPointerEXT;
+ glAPI->NormalPointerEXT = NormalPointerEXT;
+ glAPI->TexCoordPointerEXT = TexCoordPointerEXT;
+ glAPI->VertexPointerEXT = VertexPointerEXT;
+
+ /* 145. GL_EXT_secondary_color / GL 1.4 */
+ glAPI->SecondaryColor3bEXT = __indirect_glSecondaryColor3b;
+ glAPI->SecondaryColor3bvEXT = __indirect_glSecondaryColor3bv;
+ glAPI->SecondaryColor3sEXT = __indirect_glSecondaryColor3s;
+ glAPI->SecondaryColor3svEXT = __indirect_glSecondaryColor3sv;
+ glAPI->SecondaryColor3iEXT = __indirect_glSecondaryColor3i;
+ glAPI->SecondaryColor3ivEXT = __indirect_glSecondaryColor3iv;
+ glAPI->SecondaryColor3ubEXT = __indirect_glSecondaryColor3ub;
+ glAPI->SecondaryColor3ubvEXT = __indirect_glSecondaryColor3ubv;
+ glAPI->SecondaryColor3usEXT = __indirect_glSecondaryColor3us;
+ glAPI->SecondaryColor3usvEXT = __indirect_glSecondaryColor3usv;
+ glAPI->SecondaryColor3uiEXT = __indirect_glSecondaryColor3ui;
+ glAPI->SecondaryColor3uivEXT = __indirect_glSecondaryColor3uiv;
+ glAPI->SecondaryColor3fEXT = __indirect_glSecondaryColor3f;
+ glAPI->SecondaryColor3fvEXT = __indirect_glSecondaryColor3fv;
+ glAPI->SecondaryColor3dEXT = __indirect_glSecondaryColor3d;
+ glAPI->SecondaryColor3dvEXT = __indirect_glSecondaryColor3dv;
+ glAPI->SecondaryColorPointerEXT = __indirect_glSecondaryColorPointer;
+
+ /* 149. GL_EXT_fog_coord / GL 1.4 */
+ glAPI->FogCoordfEXT = __indirect_glFogCoordf;
+ glAPI->FogCoordfvEXT = __indirect_glFogCoordfv;
+ glAPI->FogCoorddEXT = __indirect_glFogCoordd;
+ glAPI->FogCoorddvEXT = __indirect_glFogCoorddv;
+ glAPI->FogCoordPointerEXT = __indirect_glFogCoordPointer;
+
+ /* 173. GL_EXT_blend_func_separate / GL 1.4 */
+ glAPI->BlendFuncSeparateEXT = __indirect_glBlendFuncSeparate;
+
+ /* 262. GL_NV_point_sprite / GL 1.4 */
+ glAPI->PointParameteriNV = __indirect_glPointParameteri;
+ glAPI->PointParameterivNV = __indirect_glPointParameteriv;
+
/* 268. GL_EXT_stencil_two_side */
glAPI->ActiveStencilFaceEXT = __indirect_glActiveStencilFaceEXT;
Index: indirect_wrap.h
===================================================================
RCS file: /cvs/xorg/xc/lib/GL/glx/indirect_wrap.h,v
retrieving revision 1.1.4.1
retrieving revision 1.1.4.2
diff -u -d -r1.1.4.1 -r1.1.4.2
--- a/indirect_wrap.h 26 Nov 2003 22:48:31 -0000 1.1.4.1
+++ b/indirect_wrap.h 23 Feb 2004 21:33:57 -0000 1.1.4.2
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/glx/indirect_wrap.h,v 1.4 2003/09/28 20:15:04 alanh Exp $ */
+/* $XFree86: xc/lib/GL/glx/indirect_wrap.h,v 1.5 2004/01/28 18:11:42 alanh Exp $ */
/**************************************************************************
Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
@@ -380,6 +380,11 @@
#define glTexImage3D __indirect_glTexImage3D
#define glTexSubImage3D __indirect_glTexSubImage3D
+/* 1.4 */
+#define glMultiDrawArrays __indirect_glMultiDrawArrays
+#define glMultiDrawElements __indirect_glMultiDrawElements
+#define glBlendFuncSeparate __indirect_glBlendFuncSeparate
+
/* GL_ARB_imaging */
#define glBlendColor __indirect_glBlendColor
#define glBlendEquation __indirect_glBlendEquation
@@ -467,10 +472,12 @@
/* FIXME: Not yet supported. */
-/* ARB 14. ARB_point_parameters */
+/* ARB 14. ARB_point_parameters / GL 1.4 / NV_point_sprite */
#define glPointParameterfARB __indirect_glPointParameterfARB
#define glPointParameterfvARB __indirect_glPointParameterfvARB
+#define glPointParameteri __indirect_glPointParameteri
+#define glPointParameteriv __indirect_glPointParameteriv
/* ARB 25. ARB_window_pos */
@@ -692,5 +699,32 @@
#define glWindowPos3ivARB __indirect_glWindowPos3ivARB
#define glWindowPos3svARB __indirect_glWindowPos3svARB
+/* 145. GL_EXT_secondary_color / GL 1.4 */
+
+#define glSecondaryColor3b __indirect_glSecondaryColor3b
+#define glSecondaryColor3bv __indirect_glSecondaryColor3bv
+#define glSecondaryColor3d __indirect_glSecondaryColor3d
+#define glSecondaryColor3dv __indirect_glSecondaryColor3dv
+#define glSecondaryColor3f __indirect_glSecondaryColor3f
+#define glSecondaryColor3fv __indirect_glSecondaryColor3fv
+#define glSecondaryColor3i __indirect_glSecondaryColor3i
+#define glSecondaryColor3iv __indirect_glSecondaryColor3iv
+#define glSecondaryColor3s __indirect_glSecondaryColor3s
+#define glSecondaryColor3sv __indirect_glSecondaryColor3sv
+#define glSecondaryColor3ub __indirect_glSecondaryColor3ub
+#define glSecondaryColor3ubv __indirect_glSecondaryColor3ubv
+#define glSecondaryColor3ui __indirect_glSecondaryColor3ui
+#define glSecondaryColor3uiv __indirect_glSecondaryColor3uiv
+#define glSecondaryColor3us __indirect_glSecondaryColor3us
+#define glSecondaryColor3usv __indirect_glSecondaryColor3usv
+#define glSecondaryColorPointer __indirect_glSecondaryColorPointer
+
+/* 149. GL_EXT_fog_coord / GL 1.4 */
+
+#define glFogCoordf __indirect_glFogCoordf
+#define glFogCoordd __indirect_glFogCoordd
+#define glFogCoordfv __indirect_glFogCoordfv
+#define glFogCoorddv __indirect_glFogCoorddv
+#define glFogCoordPointer __indirect_glFogCoordPointer
#endif /* _INDIRECT_WRAP_H_ */
Index: pixel.c
===================================================================
RCS file: /cvs/xorg/xc/lib/GL/glx/pixel.c,v
retrieving revision 1.1.4.1
retrieving revision 1.1.4.2
diff -u -d -r1.1.4.1 -r1.1.4.2
--- a/pixel.c 26 Nov 2003 22:48:31 -0000 1.1.4.1
+++ b/pixel.c 23 Feb 2004 21:33:57 -0000 1.1.4.2
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/glx/pixel.c,v 1.8 2003/09/28 20:15:04 alanh Exp $ */
+/* $XFree86: xc/lib/GL/glx/pixel.c,v 1.9 2004/01/28 18:11:42 alanh Exp $ */
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
@@ -89,11 +89,12 @@
GLenum format, const GLvoid *userdata,
GLubyte *destImage)
{
- GLint rowLength = gc->state.storeUnpack.rowLength;
- GLint alignment = gc->state.storeUnpack.alignment;
- GLint skipPixels = gc->state.storeUnpack.skipPixels;
- GLint skipRows = gc->state.storeUnpack.skipRows;
- GLint lsbFirst = gc->state.storeUnpack.lsbFirst;
+ const __GLXattribute * state = gc->client_state_private;
+ GLint rowLength = state->storeUnpack.rowLength;
+ GLint alignment = state->storeUnpack.alignment;
+ GLint skipPixels = state->storeUnpack.skipPixels;
+ GLint skipRows = state->storeUnpack.skipRows;
+ GLint lsbFirst = state->storeUnpack.lsbFirst;
GLint elementsLeft, bitOffset, currentByte, nextByte, highBitMask;
GLint lowBitMask, i;
GLint components, groupsPerRow, rowSize, padding, elementsPerRow;
@@ -165,13 +166,14 @@
GLint depth, GLenum format, GLenum type,
const GLvoid *userdata, GLubyte *newimage, GLubyte *modes)
{
- GLint rowLength = gc->state.storeUnpack.rowLength;
- GLint imageHeight = gc->state.storeUnpack.imageHeight;
- GLint alignment = gc->state.storeUnpack.alignment;
- GLint skipPixels = gc->state.storeUnpack.skipPixels;
- GLint skipRows = gc->state.storeUnpack.skipRows;
- GLint skipImages = gc->state.storeUnpack.skipImages;
- GLint swapBytes = gc->state.storeUnpack.swapEndian;
+ const __GLXattribute * state = gc->client_state_private;
+ GLint rowLength = state->storeUnpack.rowLength;
+ GLint imageHeight = state->storeUnpack.imageHeight;
+ GLint alignment = state->storeUnpack.alignment;
+ GLint skipPixels = state->storeUnpack.skipPixels;
+ GLint skipRows = state->storeUnpack.skipRows;
+ GLint skipImages = state->storeUnpack.skipImages;
+ GLint swapBytes = state->storeUnpack.swapEndian;
GLint components, elementSize, rowSize, padding, groupsPerRow, groupSize;
GLint elementsPerRow, imageSize, rowsPerImage, h, i, j, k;
const GLubyte *start, *iter, *itera, *iterb, *iterc;
@@ -283,11 +285,12 @@
GLenum format, const GLubyte *sourceImage,
GLvoid *userdata)
{
- GLint rowLength = gc->state.storePack.rowLength;
- GLint alignment = gc->state.storePack.alignment;
- GLint skipPixels = gc->state.storePack.skipPixels;
- GLint skipRows = gc->state.storePack.skipRows;
- GLint lsbFirst = gc->state.storePack.lsbFirst;
+ const __GLXattribute * state = gc->client_state_private;
+ GLint rowLength = state->storePack.rowLength;
+ GLint alignment = state->storePack.alignment;
+ GLint skipPixels = state->storePack.skipPixels;
+ GLint skipRows = state->storePack.skipRows;
+ GLint lsbFirst = state->storePack.lsbFirst;
GLint components, groupsPerRow, rowSize, padding, elementsPerRow;
GLint sourceRowSize, sourcePadding, sourceSkip;
GLubyte *start, *iter;
@@ -394,12 +397,13 @@
GLint depth, GLenum format, GLenum type,
const GLubyte *sourceImage, GLvoid *userdata)
{
- GLint rowLength = gc->state.storePack.rowLength;
- GLint imageHeight = gc->state.storePack.imageHeight;
- GLint alignment = gc->state.storePack.alignment;
- GLint skipPixels = gc->state.storePack.skipPixels;
- GLint skipRows = gc->state.storePack.skipRows;
- GLint skipImages = gc->state.storePack.skipImages;
+ const __GLXattribute * state = gc->client_state_private;
+ GLint rowLength = state->storePack.rowLength;
+ GLint imageHeight = state->storePack.imageHeight;
+ GLint alignment = state->storePack.alignment;
+ GLint skipPixels = state->storePack.skipPixels;
+ GLint skipRows = state->storePack.skipRows;
+ GLint skipImages = state->storePack.skipImages;
GLint components, elementSize, rowSize, padding, groupsPerRow, groupSize;
GLint elementsPerRow, sourceRowSize, sourcePadding, h, i;
GLint imageSize, rowsPerImage;
Index: pixelstore.c
===================================================================
RCS file: /cvs/xorg/xc/lib/GL/glx/pixelstore.c,v
retrieving revision 1.1
retrieving revision 1.1.4.1
diff -u -d -r1.1 -r1.1.4.1
--- a/pixelstore.c 14 Nov 2003 16:48:44 -0000 1.1
+++ b/pixelstore.c 23 Feb 2004 21:33:57 -0000 1.1.4.1
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/glx/pixelstore.c,v 1.3 2001/03/21 16:04:39 dawes Exp $ */
+/* $XFree86: xc/lib/GL/glx/pixelstore.c,v 1.5 2004/01/28 21:18:48 alanh Exp $ */
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
@@ -34,7 +34,9 @@
**
*/
-#include "packsingle.h"
+#include "glxclient.h"
+#include "indirect.h"
+#include "indirect_wrap.h"
/*
** Specify parameters that control the storage format of pixel arrays.
@@ -42,6 +44,7 @@
void glPixelStoref(GLenum pname, GLfloat param)
{
__GLXcontext *gc = __glXGetCurrentContext();
+ __GLXattribute * state = gc->client_state_private;
Display *dpy = gc->currentDpy;
GLuint a;
@@ -54,7 +57,7 @@
__glXSetError(gc, GL_INVALID_VALUE);
return;
}
- gc->state.storePack.rowLength = a;
+ state->storePack.rowLength = a;
break;
case GL_PACK_IMAGE_HEIGHT:
a = (GLuint) (param + 0.5);
@@ -62,7 +65,7 @@
__glXSetError(gc, GL_INVALID_VALUE);
return;
}
- gc->state.storePack.imageHeight = a;
+ state->storePack.imageHeight = a;
break;
case GL_PACK_SKIP_ROWS:
a = (GLuint) (param + 0.5);
@@ -70,7 +73,7 @@
__glXSetError(gc, GL_INVALID_VALUE);
return;
}
- gc->state.storePack.skipRows = a;
+ state->storePack.skipRows = a;
break;
case GL_PACK_SKIP_PIXELS:
a = (GLuint) (param + 0.5);
@@ -78,7 +81,7 @@
__glXSetError(gc, GL_INVALID_VALUE);
return;
}
- gc->state.storePack.skipPixels = a;
+ state->storePack.skipPixels = a;
break;
case GL_PACK_SKIP_IMAGES:
a = (GLuint) (param + 0.5);
@@ -86,13 +89,13 @@
__glXSetError(gc, GL_INVALID_VALUE);
return;
}
- gc->state.storePack.skipImages = a;
+ state->storePack.skipImages = a;
break;
case GL_PACK_ALIGNMENT:
a = (GLint) (param + 0.5);
switch (a) {
case 1: case 2: case 4: case 8:
- gc->state.storePack.alignment = a;
+ state->storePack.alignment = a;
break;
default:
__glXSetError(gc, GL_INVALID_VALUE);
@@ -100,10 +103,10 @@
}
break;
case GL_PACK_SWAP_BYTES:
- gc->state.storePack.swapEndian = (param != 0);
+ state->storePack.swapEndian = (param != 0);
break;
case GL_PACK_LSB_FIRST:
- gc->state.storePack.lsbFirst = (param != 0);
+ state->storePack.lsbFirst = (param != 0);
break;
case GL_UNPACK_ROW_LENGTH:
@@ -112,7 +115,7 @@
__glXSetError(gc, GL_INVALID_VALUE);
return;
}
- gc->state.storeUnpack.rowLength = a;
+ state->storeUnpack.rowLength = a;
break;
case GL_UNPACK_IMAGE_HEIGHT:
a = (GLuint) (param + 0.5);
@@ -120,7 +123,7 @@
__glXSetError(gc, GL_INVALID_VALUE);
return;
}
- gc->state.storeUnpack.imageHeight = a;
+ state->storeUnpack.imageHeight = a;
break;
case GL_UNPACK_SKIP_ROWS:
a = (GLuint) (param + 0.5);
@@ -128,7 +131,7 @@
__glXSetError(gc, GL_INVALID_VALUE);
return;
}
- gc->state.storeUnpack.skipRows = a;
+ state->storeUnpack.skipRows = a;
break;
case GL_UNPACK_SKIP_PIXELS:
a = (GLuint) (param + 0.5);
@@ -136,7 +139,7 @@
__glXSetError(gc, GL_INVALID_VALUE);
return;
}
- gc->state.storeUnpack.skipPixels = a;
+ state->storeUnpack.skipPixels = a;
break;
case GL_UNPACK_SKIP_IMAGES:
a = (GLuint) (param + 0.5);
@@ -144,13 +147,13 @@
__glXSetError(gc, GL_INVALID_VALUE);
return;
}
- gc->state.storeUnpack.skipImages = a;
+ state->storeUnpack.skipImages = a;
break;
case GL_UNPACK_ALIGNMENT:
a = (GLint) (param + 0.5);
switch (a) {
case 1: case 2: case 4: case 8:
- gc->state.storeUnpack.alignment = a;
+ state->storeUnpack.alignment = a;
break;
default:
__glXSetError(gc, GL_INVALID_VALUE);
@@ -158,10 +161,10 @@
}
break;
case GL_UNPACK_SWAP_BYTES:
- gc->state.storeUnpack.swapEndian = (param != 0);
+ state->storeUnpack.swapEndian = (param != 0);
break;
case GL_UNPACK_LSB_FIRST:
- gc->state.storeUnpack.lsbFirst = (param != 0);
+ state->storeUnpack.lsbFirst = (param != 0);
break;
default:
/*
@@ -177,6 +180,7 @@
void glPixelStorei(GLenum pname, GLint param)
{
__GLXcontext *gc = __glXGetCurrentContext();
+ __GLXattribute * state = gc->client_state_private;
Display *dpy = gc->currentDpy;
if (!dpy) return;
@@ -187,40 +191,40 @@
__glXSetError(gc, GL_INVALID_VALUE);
return;
}
- gc->state.storePack.rowLength = param;
+ state->storePack.rowLength = param;
break;
case GL_PACK_IMAGE_HEIGHT:
if (param < 0) {
__glXSetError(gc, GL_INVALID_VALUE);
return;
}
- gc->state.storePack.imageHeight = param;
+ state->storePack.imageHeight = param;
break;
case GL_PACK_SKIP_ROWS:
if (param < 0) {
__glXSetError(gc, GL_INVALID_VALUE);
return;
}
- gc->state.storePack.skipRows = param;
+ state->storePack.skipRows = param;
break;
case GL_PACK_SKIP_PIXELS:
if (param < 0) {
__glXSetError(gc, GL_INVALID_VALUE);
return;
}
- gc->state.storePack.skipPixels = param;
+ state->storePack.skipPixels = param;
break;
case GL_PACK_SKIP_IMAGES:
if (param < 0) {
__glXSetError(gc, GL_INVALID_VALUE);
return;
}
- gc->state.storePack.skipImages = param;
+ state->storePack.skipImages = param;
break;
case GL_PACK_ALIGNMENT:
switch (param) {
case 1: case 2: case 4: case 8:
- gc->state.storePack.alignment = param;
+ state->storePack.alignment = param;
break;
default:
__glXSetError(gc, GL_INVALID_VALUE);
@@ -228,10 +232,10 @@
}
break;
case GL_PACK_SWAP_BYTES:
- gc->state.storePack.swapEndian = (param != 0);
+ state->storePack.swapEndian = (param != 0);
break;
case GL_PACK_LSB_FIRST:
- gc->state.storePack.lsbFirst = (param != 0);
+ state->storePack.lsbFirst = (param != 0);
break;
case GL_UNPACK_ROW_LENGTH:
@@ -239,40 +243,40 @@
__glXSetError(gc, GL_INVALID_VALUE);
return;
}
- gc->state.storeUnpack.rowLength = param;
+ state->storeUnpack.rowLength = param;
break;
case GL_UNPACK_IMAGE_HEIGHT:
if (param < 0) {
__glXSetError(gc, GL_INVALID_VALUE);
return;
}
- gc->state.storeUnpack.imageHeight = param;
+ state->storeUnpack.imageHeight = param;
break;
case GL_UNPACK_SKIP_ROWS:
if (param < 0) {
__glXSetError(gc, GL_INVALID_VALUE);
return;
}
- gc->state.storeUnpack.skipRows = param;
+ state->storeUnpack.skipRows = param;
break;
case GL_UNPACK_SKIP_PIXELS:
if (param < 0) {
__glXSetError(gc, GL_INVALID_VALUE);
return;
}
- gc->state.storeUnpack.skipPixels = param;
+ state->storeUnpack.skipPixels = param;
break;
case GL_UNPACK_SKIP_IMAGES:
if (param < 0) {
__glXSetError(gc, GL_INVALID_VALUE);
return;
}
- gc->state.storeUnpack.skipImages = param;
+ state->storeUnpack.skipImages = param;
break;
case GL_UNPACK_ALIGNMENT:
switch (param) {
case 1: case 2: case 4: case 8:
- gc->state.storeUnpack.alignment = param;
+ state->storeUnpack.alignment = param;
break;
default:
__glXSetError(gc, GL_INVALID_VALUE);
@@ -280,10 +284,10 @@
}
break;
case GL_UNPACK_SWAP_BYTES:
- gc->state.storeUnpack.swapEndian = (param != 0);
+ state->storeUnpack.swapEndian = (param != 0);
break;
case GL_UNPACK_LSB_FIRST:
- gc->state.storeUnpack.lsbFirst = (param != 0);
+ state->storeUnpack.lsbFirst = (param != 0);
break;
default:
/*
Index: render2.c
===================================================================
RCS file: /cvs/xorg/xc/lib/GL/glx/render2.c,v
retrieving revision 1.1.4.1
retrieving revision 1.1.4.2
diff -u -d -r1.1.4.1 -r1.1.4.2
--- a/render2.c 26 Nov 2003 22:48:31 -0000 1.1.4.1
+++ b/render2.c 23 Feb 2004 21:33:57 -0000 1.1.4.2
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/glx/render2.c,v 1.5 2003/11/14 16:20:59 dawes Exp $ */
+/* $XFree86: xc/lib/GL/glx/render2.c,v 1.7 2004/01/31 22:44:58 alanh Exp $ */
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
@@ -426,6 +426,21 @@
__GLX_LOAD_VARIABLES();
if (!gc->currentDpy) return;
+ switch(cap) {
+ case GL_COLOR_ARRAY:
+ case GL_EDGE_FLAG_ARRAY:
+ case GL_INDEX_ARRAY:
+ case GL_NORMAL_ARRAY:
+ case GL_TEXTURE_COORD_ARRAY:
+ case GL_VERTEX_ARRAY:
+ case GL_SECONDARY_COLOR_ARRAY:
+ case GL_FOG_COORDINATE_ARRAY:
+ glEnableClientState(cap);
+ return;
+ default:
+ break;
+ }
+
__GLX_BEGIN(X_GLrop_Enable,8);
__GLX_PUT_LONG(4,cap);
__GLX_END(8);
@@ -438,6 +453,21 @@
__GLX_LOAD_VARIABLES();
if (!gc->currentDpy) return;
+ switch(cap) {
+ case GL_COLOR_ARRAY:
+ case GL_EDGE_FLAG_ARRAY:
+ case GL_INDEX_ARRAY:
+ case GL_NORMAL_ARRAY:
+ case GL_TEXTURE_COORD_ARRAY:
+ case GL_VERTEX_ARRAY:
+ case GL_SECONDARY_COLOR_ARRAY:
+ case GL_FOG_COORDINATE_ARRAY:
+ glDisableClientState(cap);
+ return;
+ default:
+ break;
+ }
+
__GLX_BEGIN(X_GLrop_Disable,8);
__GLX_PUT_LONG(4,cap);
__GLX_END(8);
Index: single2.c
===================================================================
RCS file: /cvs/xorg/xc/lib/GL/glx/single2.c,v
retrieving revision 1.1.4.1
retrieving revision 1.1.4.2
diff -u -d -r1.1.4.1 -r1.1.4.2
--- a/single2.c 26 Nov 2003 22:48:31 -0000 1.1.4.1
+++ b/single2.c 23 Feb 2004 21:33:57 -0000 1.1.4.2
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/glx/single2.c,v 1.6 2003/10/23 15:30:09 tsi Exp $ */
+/* $XFree86: xc/lib/GL/glx/single2.c,v 1.11 2004/02/11 20:01:21 dawes Exp $ */
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
@@ -126,10 +126,30 @@
__GLX_SINGLE_END();
}
+#define CASE_ARRAY_ENABLE(enum_name,array,dest,gl_type) \
+ case GL_ ## enum_name ## _ARRAY: \
+ *dest = (gl_type) state->vertArray. array .enable ; break
+#define CASE_ARRAY_SIZE(enum_name,array,dest,gl_type) \
+ case GL_ ## enum_name ## _ARRAY_SIZE: \
+ *dest = (gl_type) state->vertArray. array .size ; break
+#define CASE_ARRAY_TYPE(enum_name,array,dest,gl_type) \
+ case GL_ ## enum_name ## _ARRAY_TYPE: \
+ *dest = (gl_type) state->vertArray. array .type ; break
+#define CASE_ARRAY_STRIDE(enum_name,array,dest,gl_type) \
+ case GL_ ## enum_name ## _ARRAY_STRIDE: \
+ *dest = (gl_type) state->vertArray. 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)
+
void glGetBooleanv(GLenum val, GLboolean *b)
{
const GLenum origVal = val;
__GLX_SINGLE_DECLARE_VARIABLES();
+ __GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
xGLXSingleReply reply;
if (val == GL_TRANSPOSE_MODELVIEW_MATRIX_ARB) {
@@ -165,124 +185,131 @@
*/
switch (val) {
case GL_PACK_ROW_LENGTH:
- *b = (GLboolean)gc->state.storePack.rowLength;
+ *b = (GLboolean)state->storePack.rowLength;
break;
case GL_PACK_IMAGE_HEIGHT:
- *b = (GLboolean)gc->state.storePack.imageHeight;
+ *b = (GLboolean)state->storePack.imageHeight;
break;
case GL_PACK_SKIP_ROWS:
- *b = (GLboolean)gc->state.storePack.skipRows;
+ *b = (GLboolean)state->storePack.skipRows;
break;
case GL_PACK_SKIP_PIXELS:
- *b = (GLboolean)gc->state.storePack.skipPixels;
+ *b = (GLboolean)state->storePack.skipPixels;
break;
case GL_PACK_SKIP_IMAGES:
- *b = (GLboolean)gc->state.storePack.skipImages;
+ *b = (GLboolean)state->storePack.skipImages;
break;
case GL_PACK_ALIGNMENT:
- *b = (GLboolean)gc->state.storePack.alignment;
+ *b = (GLboolean)state->storePack.alignment;
break;
case GL_PACK_SWAP_BYTES:
- *b = (GLboolean)gc->state.storePack.swapEndian;
+ *b = (GLboolean)state->storePack.swapEndian;
break;
case GL_PACK_LSB_FIRST:
- *b = (GLboolean)gc->state.storePack.lsbFirst;
+ *b = (GLboolean)state->storePack.lsbFirst;
break;
case GL_UNPACK_ROW_LENGTH:
- *b = (GLboolean)gc->state.storeUnpack.rowLength;
+ *b = (GLboolean)state->storeUnpack.rowLength;
break;
case GL_UNPACK_IMAGE_HEIGHT:
- *b = (GLboolean)gc->state.storeUnpack.imageHeight;
+ *b = (GLboolean)state->storeUnpack.imageHeight;
break;
case GL_UNPACK_SKIP_ROWS:
- *b = (GLboolean)gc->state.storeUnpack.skipRows;
+ *b = (GLboolean)state->storeUnpack.skipRows;
break;
case GL_UNPACK_SKIP_PIXELS:
- *b = (GLboolean)gc->state.storeUnpack.skipPixels;
+ *b = (GLboolean)state->storeUnpack.skipPixels;
break;
case GL_UNPACK_SKIP_IMAGES:
- *b = (GLboolean)gc->state.storeUnpack.skipImages;
+ *b = (GLboolean)state->storeUnpack.skipImages;
break;
case GL_UNPACK_ALIGNMENT:
- *b = (GLboolean)gc->state.storeUnpack.alignment;
+ *b = (GLboolean)state->storeUnpack.alignment;
break;
case GL_UNPACK_SWAP_BYTES:
- *b = (GLboolean)gc->state.storeUnpack.swapEndian;
+ *b = (GLboolean)state->storeUnpack.swapEndian;
break;
case GL_UNPACK_LSB_FIRST:
- *b = (GLboolean)gc->state.storeUnpack.lsbFirst;
+ *b = (GLboolean)state->storeUnpack.lsbFirst;
break;
case GL_VERTEX_ARRAY:
- *b = (GLboolean)gc->state.vertArray.vertex.enable;
+ *b = (GLboolean)state->vertArray.vertex.enable;
break;
case GL_VERTEX_ARRAY_SIZE:
- *b = (GLboolean)gc->state.vertArray.vertex.size;
+ *b = (GLboolean)state->vertArray.vertex.size;
break;
case GL_VERTEX_ARRAY_TYPE:
- *b = (GLboolean)gc->state.vertArray.vertex.type;
+ *b = (GLboolean)state->vertArray.vertex.type;
break;
case GL_VERTEX_ARRAY_STRIDE:
- *b = (GLboolean)gc->state.vertArray.vertex.stride;
+ *b = (GLboolean)state->vertArray.vertex.stride;
break;
case GL_NORMAL_ARRAY:
- *b = (GLboolean)gc->state.vertArray.normal.enable;
+ *b = (GLboolean)state->vertArray.normal.enable;
break;
case GL_NORMAL_ARRAY_TYPE:
- *b = (GLboolean)gc->state.vertArray.normal.type;
+ *b = (GLboolean)state->vertArray.normal.type;
break;
case GL_NORMAL_ARRAY_STRIDE:
- *b = (GLboolean)gc->state.vertArray.normal.stride;
+ *b = (GLboolean)state->vertArray.normal.stride;
break;
case GL_COLOR_ARRAY:
- *b = (GLboolean)gc->state.vertArray.color.enable;
+ *b = (GLboolean)state->vertArray.color.enable;
break;
case GL_COLOR_ARRAY_SIZE:
- *b = (GLboolean)gc->state.vertArray.color.size;
+ *b = (GLboolean)state->vertArray.color.size;
break;
case GL_COLOR_ARRAY_TYPE:
- *b = (GLboolean)gc->state.vertArray.color.type;
+ *b = (GLboolean)state->vertArray.color.type;
break;
case GL_COLOR_ARRAY_STRIDE:
- *b = (GLboolean)gc->state.vertArray.color.stride;
+ *b = (GLboolean)state->vertArray.color.stride;
break;
case GL_INDEX_ARRAY:
- *b = (GLboolean)gc->state.vertArray.index.enable;
+ *b = (GLboolean)state->vertArray.index.enable;
break;
case GL_INDEX_ARRAY_TYPE:
- *b = (GLboolean)gc->state.vertArray.index.type;
+ *b = (GLboolean)state->vertArray.index.type;
break;
case GL_INDEX_ARRAY_STRIDE:
- *b = (GLboolean)gc->state.vertArray.index.stride;
+ *b = (GLboolean)state->vertArray.index.stride;
break;
case GL_TEXTURE_COORD_ARRAY:
- *b = (GLboolean)gc->state.vertArray.texCoord[gc->state.vertArray.activeTexture].enable;
+ *b = (GLboolean)state->vertArray.texCoord[state->vertArray.activeTexture].enable;
break;
case GL_TEXTURE_COORD_ARRAY_SIZE:
- *b = (GLboolean)gc->state.vertArray.texCoord[gc->state.vertArray.activeTexture].size;
+ *b = (GLboolean)state->vertArray.texCoord[state->vertArray.activeTexture].size;
break;
case GL_TEXTURE_COORD_ARRAY_TYPE:
- *b = (GLboolean)gc->state.vertArray.texCoord[gc->state.vertArray.activeTexture].type;
+ *b = (GLboolean)state->vertArray.texCoord[state->vertArray.activeTexture].type;
break;
case GL_TEXTURE_COORD_ARRAY_STRIDE:
- *b = (GLboolean)gc->state.vertArray.texCoord[gc->state.vertArray.activeTexture].stride;
+ *b = (GLboolean)state->vertArray.texCoord[state->vertArray.activeTexture].stride;
break;
case GL_EDGE_FLAG_ARRAY:
- *b = (GLboolean)gc->state.vertArray.edgeFlag.enable;
+ *b = (GLboolean)state->vertArray.edgeFlag.enable;
break;
case GL_EDGE_FLAG_ARRAY_STRIDE:
- *b = (GLboolean)gc->state.vertArray.edgeFlag.stride;
+ *b = (GLboolean)state->vertArray.edgeFlag.stride;
break;
+
+ CASE_ARRAY_ALL(SECONDARY_COLOR, secondaryColor, b, GLboolean);
+
+ CASE_ARRAY_ENABLE(FOG_COORDINATE, fogCoord, b, GLboolean);
+ CASE_ARRAY_TYPE(FOG_COORDINATE, fogCoord, b, GLboolean);
+ CASE_ARRAY_STRIDE(FOG_COORDINATE, fogCoord, b, GLboolean);
+
case GL_MAX_ELEMENTS_VERTICES:
- *b = (GLboolean)gc->state.vertArray.maxElementsVertices;
+ *b = (GLboolean)state->vertArray.maxElementsVertices;
break;
case GL_MAX_ELEMENTS_INDICES:
- *b = (GLboolean)gc->state.vertArray.maxElementsIndices;
+ *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)(gc->state.vertArray.activeTexture + GL_TEXTURE0_ARB);
+ *b = (GLboolean)(state->vertArray.activeTexture + GL_TEXTURE0_ARB);
break;
default:
/*
@@ -306,6 +333,7 @@
{
const GLenum origVal = val;
__GLX_SINGLE_DECLARE_VARIABLES();
+ __GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
xGLXSingleReply reply;
if (val == GL_TRANSPOSE_MODELVIEW_MATRIX_ARB) {
@@ -341,124 +369,131 @@
*/
switch (val) {
case GL_PACK_ROW_LENGTH:
- *d = (GLdouble)gc->state.storePack.rowLength;
+ *d = (GLdouble)state->storePack.rowLength;
break;
case GL_PACK_IMAGE_HEIGHT:
- *d = (GLdouble)gc->state.storePack.imageHeight;
+ *d = (GLdouble)state->storePack.imageHeight;
break;
case GL_PACK_SKIP_ROWS:
- *d = (GLdouble)gc->state.storePack.skipRows;
+ *d = (GLdouble)state->storePack.skipRows;
break;
case GL_PACK_SKIP_PIXELS:
- *d = (GLdouble)gc->state.storePack.skipPixels;
+ *d = (GLdouble)state->storePack.skipPixels;
break;
case GL_PACK_SKIP_IMAGES:
- *d = (GLdouble)gc->state.storePack.skipImages;
+ *d = (GLdouble)state->storePack.skipImages;
break;
case GL_PACK_ALIGNMENT:
- *d = (GLdouble)gc->state.storePack.alignment;
+ *d = (GLdouble)state->storePack.alignment;
break;
case GL_PACK_SWAP_BYTES:
- *d = (GLdouble)gc->state.storePack.swapEndian;
+ *d = (GLdouble)state->storePack.swapEndian;
break;
case GL_PACK_LSB_FIRST:
- *d = (GLdouble)gc->state.storePack.lsbFirst;
+ *d = (GLdouble)state->storePack.lsbFirst;
break;
case GL_UNPACK_ROW_LENGTH:
- *d = (GLdouble)gc->state.storeUnpack.rowLength;
+ *d = (GLdouble)state->storeUnpack.rowLength;
break;
case GL_UNPACK_IMAGE_HEIGHT:
- *d = (GLdouble)gc->state.storeUnpack.imageHeight;
+ *d = (GLdouble)state->storeUnpack.imageHeight;
break;
case GL_UNPACK_SKIP_ROWS:
- *d = (GLdouble)gc->state.storeUnpack.skipRows;
+ *d = (GLdouble)state->storeUnpack.skipRows;
break;
case GL_UNPACK_SKIP_PIXELS:
- *d = (GLdouble)gc->state.storeUnpack.skipPixels;
+ *d = (GLdouble)state->storeUnpack.skipPixels;
break;
case GL_UNPACK_SKIP_IMAGES:
- *d = (GLdouble)gc->state.storeUnpack.skipImages;
+ *d = (GLdouble)state->storeUnpack.skipImages;
break;
case GL_UNPACK_ALIGNMENT:
- *d = (GLdouble)gc->state.storeUnpack.alignment;
+ *d = (GLdouble)state->storeUnpack.alignment;
break;
case GL_UNPACK_SWAP_BYTES:
- *d = (GLdouble)gc->state.storeUnpack.swapEndian;
+ *d = (GLdouble)state->storeUnpack.swapEndian;
break;
case GL_UNPACK_LSB_FIRST:
- *d = (GLdouble)gc->state.storeUnpack.lsbFirst;
+ *d = (GLdouble)state->storeUnpack.lsbFirst;
break;
case GL_VERTEX_ARRAY:
- *d = (GLdouble)gc->state.vertArray.vertex.enable;
+ *d = (GLdouble)state->vertArray.vertex.enable;
break;
case GL_VERTEX_ARRAY_SIZE:
- *d = (GLdouble)gc->state.vertArray.vertex.size;
+ *d = (GLdouble)state->vertArray.vertex.size;
break;
case GL_VERTEX_ARRAY_TYPE:
- *d = (GLdouble)gc->state.vertArray.vertex.type;
+ *d = (GLdouble)state->vertArray.vertex.type;
break;
case GL_VERTEX_ARRAY_STRIDE:
- *d = (GLdouble)gc->state.vertArray.vertex.stride;
+ *d = (GLdouble)state->vertArray.vertex.stride;
break;
case GL_NORMAL_ARRAY:
- *d = (GLdouble)gc->state.vertArray.normal.enable;
+ *d = (GLdouble)state->vertArray.normal.enable;
break;
case GL_NORMAL_ARRAY_TYPE:
- *d = (GLdouble)gc->state.vertArray.normal.type;
+ *d = (GLdouble)state->vertArray.normal.type;
break;
case GL_NORMAL_ARRAY_STRIDE:
- *d = (GLdouble)gc->state.vertArray.normal.stride;
+ *d = (GLdouble)state->vertArray.normal.stride;
break;
case GL_COLOR_ARRAY:
- *d = (GLdouble)gc->state.vertArray.color.enable;
+ *d = (GLdouble)state->vertArray.color.enable;
break;
case GL_COLOR_ARRAY_SIZE:
- *d = (GLdouble)gc->state.vertArray.color.size;
+ *d = (GLdouble)state->vertArray.color.size;
break;
case GL_COLOR_ARRAY_TYPE:
- *d = (GLdouble)gc->state.vertArray.color.type;
+ *d = (GLdouble)state->vertArray.color.type;
break;
case GL_COLOR_ARRAY_STRIDE:
- *d = (GLdouble)gc->state.vertArray.color.stride;
+ *d = (GLdouble)state->vertArray.color.stride;
break;
case GL_INDEX_ARRAY:
- *d = (GLdouble)gc->state.vertArray.index.enable;
+ *d = (GLdouble)state->vertArray.index.enable;
break;
case GL_INDEX_ARRAY_TYPE:
- *d = (GLdouble)gc->state.vertArray.index.type;
+ *d = (GLdouble)state->vertArray.index.type;
break;
case GL_INDEX_ARRAY_STRIDE:
- *d = (GLdouble)gc->state.vertArray.index.stride;
+ *d = (GLdouble)state->vertArray.index.stride;
break;
case GL_TEXTURE_COORD_ARRAY:
- *d = (GLdouble)gc->state.vertArray.texCoord[gc->state.vertArray.activeTexture].enable;
+ *d = (GLdouble)state->vertArray.texCoord[state->vertArray.activeTexture].enable;
break;
case GL_TEXTURE_COORD_ARRAY_SIZE:
- *d = (GLdouble)gc->state.vertArray.texCoord[gc->state.vertArray.activeTexture].size;
+ *d = (GLdouble)state->vertArray.texCoord[state->vertArray.activeTexture].size;
break;
case GL_TEXTURE_COORD_ARRAY_TYPE:
- *d = (GLdouble)gc->state.vertArray.texCoord[gc->state.vertArray.activeTexture].type;
+ *d = (GLdouble)state->vertArray.texCoord[state->vertArray.activeTexture].type;
break;
case GL_TEXTURE_COORD_ARRAY_STRIDE:
- *d = (GLdouble)gc->state.vertArray.texCoord[gc->state.vertArray.activeTexture].stride;
+ *d = (GLdouble)state->vertArray.texCoord[state->vertArray.activeTexture].stride;
break;
case GL_EDGE_FLAG_ARRAY:
- *d = (GLdouble)gc->state.vertArray.edgeFlag.enable;
+ *d = (GLdouble)state->vertArray.edgeFlag.enable;
break;
case GL_EDGE_FLAG_ARRAY_STRIDE:
- *d = (GLdouble)gc->state.vertArray.edgeFlag.stride;
+ *d = (GLdouble)state->vertArray.edgeFlag.stride;
break;
+
+ CASE_ARRAY_ALL(SECONDARY_COLOR, secondaryColor, d, GLdouble);
+
+ CASE_ARRAY_ENABLE(FOG_COORDINATE, fogCoord, d, GLdouble);
+ CASE_ARRAY_TYPE(FOG_COORDINATE, fogCoord, d, GLdouble);
+ CASE_ARRAY_STRIDE(FOG_COORDINATE, fogCoord, d, GLdouble);
+
case GL_MAX_ELEMENTS_VERTICES:
- *d = (GLdouble)gc->state.vertArray.maxElementsVertices;
+ *d = (GLdouble)state->vertArray.maxElementsVertices;
break;
case GL_MAX_ELEMENTS_INDICES:
- *d = (GLdouble)gc->state.vertArray.maxElementsIndices;
+ *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)(gc->state.vertArray.activeTexture + GL_TEXTURE0_ARB);
+ *d = (GLdouble)(state->vertArray.activeTexture + GL_TEXTURE0_ARB);
break;
default:
/*
@@ -482,6 +517,7 @@
{
const GLenum origVal = val;
__GLX_SINGLE_DECLARE_VARIABLES();
+ __GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
xGLXSingleReply reply;
if (val == GL_TRANSPOSE_MODELVIEW_MATRIX_ARB) {
@@ -517,124 +553,131 @@
*/
switch (val) {
case GL_PACK_ROW_LENGTH:
- *f = (GLfloat)gc->state.storePack.rowLength;
+ *f = (GLfloat)state->storePack.rowLength;
break;
case GL_PACK_IMAGE_HEIGHT:
- *f = (GLfloat)gc->state.storePack.imageHeight;
+ *f = (GLfloat)state->storePack.imageHeight;
break;
case GL_PACK_SKIP_ROWS:
- *f = (GLfloat)gc->state.storePack.skipRows;
+ *f = (GLfloat)state->storePack.skipRows;
break;
case GL_PACK_SKIP_PIXELS:
- *f = (GLfloat)gc->state.storePack.skipPixels;
+ *f = (GLfloat)state->storePack.skipPixels;
break;
case GL_PACK_SKIP_IMAGES:
- *f = (GLfloat)gc->state.storePack.skipImages;
+ *f = (GLfloat)state->storePack.skipImages;
break;
case GL_PACK_ALIGNMENT:
- *f = (GLfloat)gc->state.storePack.alignment;
+ *f = (GLfloat)state->storePack.alignment;
break;
case GL_PACK_SWAP_BYTES:
- *f = (GLfloat)gc->state.storePack.swapEndian;
+ *f = (GLfloat)state->storePack.swapEndian;
break;
case GL_PACK_LSB_FIRST:
- *f = (GLfloat)gc->state.storePack.lsbFirst;
+ *f = (GLfloat)state->storePack.lsbFirst;
break;
case GL_UNPACK_ROW_LENGTH:
- *f = (GLfloat)gc->state.storeUnpack.rowLength;
+ *f = (GLfloat)state->storeUnpack.rowLength;
break;
case GL_UNPACK_IMAGE_HEIGHT:
- *f = (GLfloat)gc->state.storeUnpack.imageHeight;
+ *f = (GLfloat)state->storeUnpack.imageHeight;
break;
case GL_UNPACK_SKIP_ROWS:
- *f = (GLfloat)gc->state.storeUnpack.skipRows;
+ *f = (GLfloat)state->storeUnpack.skipRows;
break;
case GL_UNPACK_SKIP_PIXELS:
- *f = (GLfloat)gc->state.storeUnpack.skipPixels;
+ *f = (GLfloat)state->storeUnpack.skipPixels;
break;
case GL_UNPACK_SKIP_IMAGES:
- *f = (GLfloat)gc->state.storeUnpack.skipImages;
+ *f = (GLfloat)state->storeUnpack.skipImages;
break;
case GL_UNPACK_ALIGNMENT:
- *f = (GLfloat)gc->state.storeUnpack.alignment;
+ *f = (GLfloat)state->storeUnpack.alignment;
break;
case GL_UNPACK_SWAP_BYTES:
- *f = (GLfloat)gc->state.storeUnpack.swapEndian;
+ *f = (GLfloat)state->storeUnpack.swapEndian;
break;
case GL_UNPACK_LSB_FIRST:
- *f = (GLfloat)gc->state.storeUnpack.lsbFirst;
+ *f = (GLfloat)state->storeUnpack.lsbFirst;
break;
case GL_VERTEX_ARRAY:
- *f = (GLfloat)gc->state.vertArray.vertex.enable;
+ *f = (GLfloat)state->vertArray.vertex.enable;
break;
case GL_VERTEX_ARRAY_SIZE:
- *f = (GLfloat)gc->state.vertArray.vertex.size;
+ *f = (GLfloat)state->vertArray.vertex.size;
break;
case GL_VERTEX_ARRAY_TYPE:
- *f = (GLfloat)gc->state.vertArray.vertex.type;
+ *f = (GLfloat)state->vertArray.vertex.type;
break;
case GL_VERTEX_ARRAY_STRIDE:
- *f = (GLfloat)gc->state.vertArray.vertex.stride;
+ *f = (GLfloat)state->vertArray.vertex.stride;
break;
case GL_NORMAL_ARRAY:
- *f = (GLfloat)gc->state.vertArray.normal.enable;
+ *f = (GLfloat)state->vertArray.normal.enable;
break;
case GL_NORMAL_ARRAY_TYPE:
- *f = (GLfloat)gc->state.vertArray.normal.type;
+ *f = (GLfloat)state->vertArray.normal.type;
break;
case GL_NORMAL_ARRAY_STRIDE:
- *f = (GLfloat)gc->state.vertArray.normal.stride;
+ *f = (GLfloat)state->vertArray.normal.stride;
break;
case GL_COLOR_ARRAY:
- *f = (GLfloat)gc->state.vertArray.color.enable;
+ *f = (GLfloat)state->vertArray.color.enable;
break;
case GL_COLOR_ARRAY_SIZE:
- *f = (GLfloat)gc->state.vertArray.color.size;
+ *f = (GLfloat)state->vertArray.color.size;
break;
case GL_COLOR_ARRAY_TYPE:
- *f = (GLfloat)gc->state.vertArray.color.type;
+ *f = (GLfloat)state->vertArray.color.type;
break;
case GL_COLOR_ARRAY_STRIDE:
- *f = (GLfloat)gc->state.vertArray.color.stride;
+ *f = (GLfloat)state->vertArray.color.stride;
break;
case GL_INDEX_ARRAY:
- *f = (GLfloat)gc->state.vertArray.index.enable;
+ *f = (GLfloat)state->vertArray.index.enable;
break;
case GL_INDEX_ARRAY_TYPE:
- *f = (GLfloat)gc->state.vertArray.index.type;
+ *f = (GLfloat)state->vertArray.index.type;
break;
case GL_INDEX_ARRAY_STRIDE:
- *f = (GLfloat)gc->state.vertArray.index.stride;
+ *f = (GLfloat)state->vertArray.index.stride;
break;
case GL_TEXTURE_COORD_ARRAY:
- *f = (GLfloat)gc->state.vertArray.texCoord[gc->state.vertArray.activeTexture].enable;
+ *f = (GLfloat)state->vertArray.texCoord[state->vertArray.activeTexture].enable;
break;
case GL_TEXTURE_COORD_ARRAY_SIZE:
- *f = (GLfloat)gc->state.vertArray.texCoord[gc->state.vertArray.activeTexture].size;
+ *f = (GLfloat)state->vertArray.texCoord[state->vertArray.activeTexture].size;
break;
case GL_TEXTURE_COORD_ARRAY_TYPE:
- *f = (GLfloat)gc->state.vertArray.texCoord[gc->state.vertArray.activeTexture].type;
+ *f = (GLfloat)state->vertArray.texCoord[state->vertArray.activeTexture].type;
break;
case GL_TEXTURE_COORD_ARRAY_STRIDE:
- *f = (GLfloat)gc->state.vertArray.texCoord[gc->state.vertArray.activeTexture].stride;
+ *f = (GLfloat)state->vertArray.texCoord[state->vertArray.activeTexture].stride;
break;
case GL_EDGE_FLAG_ARRAY:
- *f = (GLfloat)gc->state.vertArray.edgeFlag.enable;
+ *f = (GLfloat)state->vertArray.edgeFlag.enable;
break;
case GL_EDGE_FLAG_ARRAY_STRIDE:
- *f = (GLfloat)gc->state.vertArray.edgeFlag.stride;
+ *f = (GLfloat)state->vertArray.edgeFlag.stride;
break;
+
+ CASE_ARRAY_ALL(SECONDARY_COLOR, secondaryColor, f, GLfloat);
+
+ CASE_ARRAY_ENABLE(FOG_COORDINATE, fogCoord, f, GLfloat);
+ CASE_ARRAY_TYPE(FOG_COORDINATE, fogCoord, f, GLfloat);
+ CASE_ARRAY_STRIDE(FOG_COORDINATE, fogCoord, f, GLfloat);
+
case GL_MAX_ELEMENTS_VERTICES:
- *f = (GLfloat)gc->state.vertArray.maxElementsVertices;
+ *f = (GLfloat)state->vertArray.maxElementsVertices;
break;
case GL_MAX_ELEMENTS_INDICES:
- *f = (GLfloat)gc->state.vertArray.maxElementsIndices;
+ *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)(gc->state.vertArray.activeTexture + GL_TEXTURE0_ARB);
+ *f = (GLfloat)(state->vertArray.activeTexture + GL_TEXTURE0_ARB);
break;
default:
/*
@@ -658,6 +701,7 @@
{
const GLenum origVal = val;
__GLX_SINGLE_DECLARE_VARIABLES();
+ __GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
xGLXSingleReply reply;
if (val == GL_TRANSPOSE_MODELVIEW_MATRIX_ARB) {
@@ -693,124 +737,131 @@
*/
switch (val) {
case GL_PACK_ROW_LENGTH:
- *i = (GLint)gc->state.storePack.rowLength;
+ *i = (GLint)state->storePack.rowLength;
break;
case GL_PACK_IMAGE_HEIGHT:
- *i = (GLint)gc->state.storePack.imageHeight;
+ *i = (GLint)state->storePack.imageHeight;
break;
case GL_PACK_SKIP_ROWS:
- *i = (GLint)gc->state.storePack.skipRows;
+ *i = (GLint)state->storePack.skipRows;
break;
case GL_PACK_SKIP_PIXELS:
- *i = (GLint)gc->state.storePack.skipPixels;
+ *i = (GLint)state->storePack.skipPixels;
break;
case GL_PACK_SKIP_IMAGES:
- *i = (GLint)gc->state.storePack.skipImages;
+ *i = (GLint)state->storePack.skipImages;
break;
case GL_PACK_ALIGNMENT:
- *i = (GLint)gc->state.storePack.alignment;
+ *i = (GLint)state->storePack.alignment;
break;
case GL_PACK_SWAP_BYTES:
- *i = (GLint)gc->state.storePack.swapEndian;
+ *i = (GLint)state->storePack.swapEndian;
break;
case GL_PACK_LSB_FIRST:
- *i = (GLint)gc->state.storePack.lsbFirst;
+ *i = (GLint)state->storePack.lsbFirst;
break;
case GL_UNPACK_ROW_LENGTH:
- *i = (GLint)gc->state.storeUnpack.rowLength;
+ *i = (GLint)state->storeUnpack.rowLength;
break;
case GL_UNPACK_IMAGE_HEIGHT:
- *i = (GLint)gc->state.storeUnpack.imageHeight;
+ *i = (GLint)state->storeUnpack.imageHeight;
break;
case GL_UNPACK_SKIP_ROWS:
- *i = (GLint)gc->state.storeUnpack.skipRows;
+ *i = (GLint)state->storeUnpack.skipRows;
break;
case GL_UNPACK_SKIP_PIXELS:
- *i = (GLint)gc->state.storeUnpack.skipPixels;
+ *i = (GLint)state->storeUnpack.skipPixels;
break;
case GL_UNPACK_SKIP_IMAGES:
- *i = (GLint)gc->state.storeUnpack.skipImages;
+ *i = (GLint)state->storeUnpack.skipImages;
break;
case GL_UNPACK_ALIGNMENT:
- *i = (GLint)gc->state.storeUnpack.alignment;
+ *i = (GLint)state->storeUnpack.alignment;
break;
case GL_UNPACK_SWAP_BYTES:
- *i = (GLint)gc->state.storeUnpack.swapEndian;
+ *i = (GLint)state->storeUnpack.swapEndian;
break;
case GL_UNPACK_LSB_FIRST:
- *i = (GLint)gc->state.storeUnpack.lsbFirst;
+ *i = (GLint)state->storeUnpack.lsbFirst;
break;
case GL_VERTEX_ARRAY:
- *i = (GLint)gc->state.vertArray.vertex.enable;
+ *i = (GLint)state->vertArray.vertex.enable;
break;
case GL_VERTEX_ARRAY_SIZE:
- *i = (GLint)gc->state.vertArray.vertex.size;
+ *i = (GLint)state->vertArray.vertex.size;
break;
case GL_VERTEX_ARRAY_TYPE:
- *i = (GLint)gc->state.vertArray.vertex.type;
+ *i = (GLint)state->vertArray.vertex.type;
break;
case GL_VERTEX_ARRAY_STRIDE:
- *i = (GLint)gc->state.vertArray.vertex.stride;
+ *i = (GLint)state->vertArray.vertex.stride;
break;
case GL_NORMAL_ARRAY:
- *i = (GLint)gc->state.vertArray.normal.enable;
+ *i = (GLint)state->vertArray.normal.enable;
break;
case GL_NORMAL_ARRAY_TYPE:
- *i = (GLint)gc->state.vertArray.normal.type;
+ *i = (GLint)state->vertArray.normal.type;
break;
case GL_NORMAL_ARRAY_STRIDE:
- *i = (GLint)gc->state.vertArray.normal.stride;
+ *i = (GLint)state->vertArray.normal.stride;
break;
case GL_COLOR_ARRAY:
- *i = (GLint)gc->state.vertArray.color.enable;
+ *i = (GLint)state->vertArray.color.enable;
break;
case GL_COLOR_ARRAY_SIZE:
- *i = (GLint)gc->state.vertArray.color.size;
+ *i = (GLint)state->vertArray.color.size;
break;
case GL_COLOR_ARRAY_TYPE:
- *i = (GLint)gc->state.vertArray.color.type;
+ *i = (GLint)state->vertArray.color.type;
break;
case GL_COLOR_ARRAY_STRIDE:
- *i = (GLint)gc->state.vertArray.color.stride;
+ *i = (GLint)state->vertArray.color.stride;
break;
case GL_INDEX_ARRAY:
- *i = (GLint)gc->state.vertArray.index.enable;
+ *i = (GLint)state->vertArray.index.enable;
break;
case GL_INDEX_ARRAY_TYPE:
- *i = (GLint)gc->state.vertArray.index.type;
+ *i = (GLint)state->vertArray.index.type;
break;
case GL_INDEX_ARRAY_STRIDE:
- *i = (GLint)gc->state.vertArray.index.stride;
+ *i = (GLint)state->vertArray.index.stride;
break;
case GL_TEXTURE_COORD_ARRAY:
- *i = (GLint)gc->state.vertArray.texCoord[gc->state.vertArray.activeTexture].enable;
+ *i = (GLint)state->vertArray.texCoord[state->vertArray.activeTexture].enable;
break;
case GL_TEXTURE_COORD_ARRAY_SIZE:
- *i = (GLint)gc->state.vertArray.texCoord[gc->state.vertArray.activeTexture].size;
+ *i = (GLint)state->vertArray.texCoord[state->vertArray.activeTexture].size;
break;
case GL_TEXTURE_COORD_ARRAY_TYPE:
- *i = (GLint)gc->state.vertArray.texCoord[gc->state.vertArray.activeTexture].type;
+ *i = (GLint)state->vertArray.texCoord[state->vertArray.activeTexture].type;
break;
case GL_TEXTURE_COORD_ARRAY_STRIDE:
- *i = (GLint)gc->state.vertArray.texCoord[gc->state.vertArray.activeTexture].stride;
+ *i = (GLint)state->vertArray.texCoord[state->vertArray.activeTexture].stride;
break;
case GL_EDGE_FLAG_ARRAY:
- *i = (GLint)gc->state.vertArray.edgeFlag.enable;
+ *i = (GLint)state->vertArray.edgeFlag.enable;
break;
case GL_EDGE_FLAG_ARRAY_STRIDE:
- *i = (GLint)gc->state.vertArray.edgeFlag.stride;
+ *i = (GLint)state->vertArray.edgeFlag.stride;
break;
+
+ CASE_ARRAY_ALL(SECONDARY_COLOR, secondaryColor, i, GLint);
+
+ CASE_ARRAY_ENABLE(FOG_COORDINATE, fogCoord, i, GLint);
+ CASE_ARRAY_TYPE(FOG_COORDINATE, fogCoord, i, GLint);
+ CASE_ARRAY_STRIDE(FOG_COORDINATE, fogCoord, i, GLint);
+
case GL_MAX_ELEMENTS_VERTICES:
- *i = (GLint)gc->state.vertArray.maxElementsVertices;
+ *i = (GLint)state->vertArray.maxElementsVertices;
break;
case GL_MAX_ELEMENTS_INDICES:
- *i = (GLint)gc->state.vertArray.maxElementsIndices;
+ *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)(gc->state.vertArray.activeTexture + GL_TEXTURE0_ARB);
+ *i = (GLint)(state->vertArray.activeTexture + GL_TEXTURE0_ARB);
break;
default:
/*
@@ -979,13 +1030,37 @@
case GL_RENDERER:
gc->renderer = s;
break;
- case GL_VERSION:
- gc->version = s;
- break;
+ case GL_VERSION: {
+ double server_version = strtod((char *)s, NULL);
+ double client_version = strtod(__glXGLClientVersion, NULL);
+
+ if ( server_version <= client_version ) {
+ gc->version = s;
+ }
+ else {
+ gc->version = Xmalloc( strlen(__glXGLClientVersion)
+ + strlen((char *)s) + 4 );
+ if ( gc->version == NULL ) {
+ /* If we couldn't allocate memory for the new string,
+ * make a best-effort and just copy the client-side version
+ * to the string and use that. It probably doesn't
+ * matter what is done here. If there not memory available
+ * for a short string, the system is probably going to die
+ * soon anyway.
+ */
+ strcpy((char *)s, __glXGLClientVersion);
+ }
+ else {
+ sprintf( (char *)gc->version, "%s (%s)",
+ __glXGLClientVersion, s );
+ Xfree( s );
+ s = gc->version;
+ }
+ }
+ break;
+ }
case GL_EXTENSIONS:
- gc->extensions =
- (GLubyte *)__glXCombineExtensionStrings( (char *)s,
- __glXGLClientExtensions );
+ gc->extensions = (GLubyte *)__glXCombineExtensionStrings( (const char *)s, __glXGLClientExtensions );
XFree( s );
s = gc->extensions;
break;
@@ -998,6 +1073,7 @@
GLboolean glIsEnabled(GLenum cap)
{
__GLX_SINGLE_DECLARE_VARIABLES();
+ __GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
xGLXSingleReply reply;
GLboolean retval = 0;
@@ -1005,17 +1081,21 @@
switch(cap) {
case GL_VERTEX_ARRAY:
- return gc->state.vertArray.vertex.enable;
+ return state->vertArray.vertex.enable;
case GL_NORMAL_ARRAY:
- return gc->state.vertArray.normal.enable;
+ return state->vertArray.normal.enable;
case GL_COLOR_ARRAY:
- return gc->state.vertArray.color.enable;
+ return state->vertArray.color.enable;
case GL_INDEX_ARRAY:
- return gc->state.vertArray.index.enable;
+ return state->vertArray.index.enable;
case GL_TEXTURE_COORD_ARRAY:
- return gc->state.vertArray.texCoord[gc->state.vertArray.activeTexture].enable;
+ return state->vertArray.texCoord[state->vertArray.activeTexture].enable;
case GL_EDGE_FLAG_ARRAY:
- return gc->state.vertArray.edgeFlag.enable;
+ return state->vertArray.edgeFlag.enable;
+ case GL_SECONDARY_COLOR_ARRAY:
+ return state->vertArray.secondaryColor.enable;
+ case GL_FOG_COORDINATE_ARRAY:
+ return state->vertArray.fogCoord.enable;
}
__GLX_SINGLE_LOAD_VARIABLES();
@@ -1030,28 +1110,35 @@
void glGetPointerv(GLenum pname, void **params)
{
__GLXcontext *gc = __glXGetCurrentContext();
+ __GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
Display *dpy = gc->currentDpy;
if (!dpy) return;
switch(pname) {
case GL_VERTEX_ARRAY_POINTER:
- *params = (void *)gc->state.vertArray.vertex.ptr;
+ *params = (void *)state->vertArray.vertex.ptr;
return;
case GL_NORMAL_ARRAY_POINTER:
- *params = (void *)gc->state.vertArray.normal.ptr;
+ *params = (void *)state->vertArray.normal.ptr;
return;
case GL_COLOR_ARRAY_POINTER:
- *params = (void *)gc->state.vertArray.color.ptr;
+ *params = (void *)state->vertArray.color.ptr;
return;
case GL_INDEX_ARRAY_POINTER:
- *params = (void *)gc->state.vertArray.index.ptr;
+ *params = (void *)state->vertArray.index.ptr;
return;
case GL_TEXTURE_COORD_ARRAY_POINTER:
- *params = (void *)gc->state.vertArray.texCoord[gc->state.vertArray.activeTexture].ptr;
+ *params = (void *)state->vertArray.texCoord[state->vertArray.activeTexture].ptr;
return;
case GL_EDGE_FLAG_ARRAY_POINTER:
- *params = (void *)gc->state.vertArray.edgeFlag.ptr;
+ *params = (void *)state->vertArray.edgeFlag.ptr;
+ return;
+ case GL_SECONDARY_COLOR_ARRAY_POINTER:
+ *params = (void *)state->vertArray.secondaryColor.ptr;
+ return;
+ case GL_FOG_COORDINATE_ARRAY_POINTER:
+ *params = (void *)state->vertArray.fogCoord.ptr;
return;
case GL_FEEDBACK_BUFFER_POINTER:
*params = (void *)gc->feedbackBuf;
Index: singlepix.c
===================================================================
RCS file: /cvs/xorg/xc/lib/GL/glx/singlepix.c,v
retrieving revision 1.1
retrieving revision 1.1.4.1
diff -u -d -r1.1 -r1.1.4.1
--- a/singlepix.c 14 Nov 2003 16:48:44 -0000 1.1
+++ b/singlepix.c 23 Feb 2004 21:33:57 -0000 1.1.4.1
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/glx/singlepix.c,v 1.3 2001/03/21 16:04:39 dawes Exp $ */
+/* $XFree86: xc/lib/GL/glx/singlepix.c,v 1.4 2004/01/28 18:11:43 alanh Exp $ */
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
@@ -40,11 +40,13 @@
GLenum format, GLenum type, GLvoid *pixels)
{
__GLX_SINGLE_DECLARE_VARIABLES();
+ const __GLXattribute * state;
xGLXReadPixelsReply reply;
GLubyte *buf;
if (!dpy) return;
__GLX_SINGLE_LOAD_VARIABLES();
+ state = gc->client_state_private;
/* Send request */
__GLX_SINGLE_BEGIN(X_GLsop_ReadPixels,__GLX_PAD(26));
@@ -54,7 +56,7 @@
__GLX_SINGLE_PUT_LONG(12,height);
__GLX_SINGLE_PUT_LONG(16,format);
__GLX_SINGLE_PUT_LONG(20,type);
- __GLX_SINGLE_PUT_CHAR(24,gc->state.storePack.swapEndian);
+ __GLX_SINGLE_PUT_CHAR(24,state->storePack.swapEndian);
__GLX_SINGLE_PUT_CHAR(25,GL_FALSE);
__GLX_SINGLE_READ_XREPLY();
compsize = reply.length << 2;
@@ -87,11 +89,13 @@
GLvoid *texels)
{
__GLX_SINGLE_DECLARE_VARIABLES();
+ const __GLXattribute * state;
xGLXGetTexImageReply reply;
GLubyte *buf;
if (!dpy) return;
__GLX_SINGLE_LOAD_VARIABLES();
+ state = gc->client_state_private;
/* Send request */
__GLX_SINGLE_BEGIN(X_GLsop_GetTexImage,__GLX_PAD(17));
@@ -99,7 +103,7 @@
__GLX_SINGLE_PUT_LONG(4,level);
__GLX_SINGLE_PUT_LONG(8,format);
__GLX_SINGLE_PUT_LONG(12,type);
- __GLX_SINGLE_PUT_CHAR(16,gc->state.storePack.swapEndian);
+ __GLX_SINGLE_PUT_CHAR(16,state->storePack.swapEndian);
__GLX_SINGLE_READ_XREPLY();
compsize = reply.length << 2;
@@ -155,18 +159,20 @@
void glGetColorTable(GLenum target, GLenum format, GLenum type, GLvoid *table)
{
__GLX_SINGLE_DECLARE_VARIABLES();
+ const __GLXattribute * state;
xGLXGetColorTableReply reply;
GLubyte *buf;
if (!dpy) return;
__GLX_SINGLE_LOAD_VARIABLES();
+ state = gc->client_state_private;
/* Send request */
__GLX_SINGLE_BEGIN(X_GLsop_GetColorTable,__GLX_PAD(13));
__GLX_SINGLE_PUT_LONG(0,(long)target);
__GLX_SINGLE_PUT_LONG(4,(long)format);
__GLX_SINGLE_PUT_LONG(8,(long)type);
- __GLX_SINGLE_PUT_CHAR(12,gc->state.storePack.swapEndian);
+ __GLX_SINGLE_PUT_CHAR(12,state->storePack.swapEndian);
__GLX_SINGLE_READ_XREPLY();
compsize = (long)reply.length << 2;
@@ -201,18 +207,20 @@
GLvoid *image)
{
__GLX_SINGLE_DECLARE_VARIABLES();
+ const __GLXattribute * state;
xGLXGetConvolutionFilterReply reply;
GLubyte *buf;
if (!dpy) return;
__GLX_SINGLE_LOAD_VARIABLES();
+ state = gc->client_state_private;
/* Send request */
__GLX_SINGLE_BEGIN(X_GLsop_GetConvolutionFilter, __GLX_PAD(13));
__GLX_SINGLE_PUT_LONG(0,target);
__GLX_SINGLE_PUT_LONG(4,format);
__GLX_SINGLE_PUT_LONG(8,type);
- __GLX_SINGLE_PUT_CHAR(12,gc->state.storePack.swapEndian);
+ __GLX_SINGLE_PUT_CHAR(12,state->storePack.swapEndian);
__GLX_SINGLE_READ_XREPLY();
compsize = reply.length << 2;
@@ -248,18 +256,20 @@
GLvoid *row, GLvoid *column, GLvoid *span)
{
__GLX_SINGLE_DECLARE_VARIABLES();
+ const __GLXattribute * state;
xGLXGetSeparableFilterReply reply;
GLubyte *rowBuf, *colBuf;
if (!dpy) return;
__GLX_SINGLE_LOAD_VARIABLES();
+ state = gc->client_state_private;
/* Send request */
__GLX_SINGLE_BEGIN(X_GLsop_GetSeparableFilter, __GLX_PAD(13));
__GLX_SINGLE_PUT_LONG(0,target);
__GLX_SINGLE_PUT_LONG(4,format);
__GLX_SINGLE_PUT_LONG(8,type);
- __GLX_SINGLE_PUT_CHAR(12,gc->state.storePack.swapEndian);
+ __GLX_SINGLE_PUT_CHAR(12,state->storePack.swapEndian);
__GLX_SINGLE_READ_XREPLY();
compsize = reply.length << 2;
@@ -313,18 +323,20 @@
GLenum type, GLvoid *values)
{
__GLX_SINGLE_DECLARE_VARIABLES();
+ const __GLXattribute * state;
xGLXGetHistogramReply reply;
GLubyte *buf;
if (!dpy) return;
__GLX_SINGLE_LOAD_VARIABLES();
+ state = gc->client_state_private;
/* Send request */
__GLX_SINGLE_BEGIN(X_GLsop_GetHistogram,__GLX_PAD(14));
__GLX_SINGLE_PUT_LONG(0,(long)target);
__GLX_SINGLE_PUT_LONG(4,(long)format);
__GLX_SINGLE_PUT_LONG(8,(long)type);
- __GLX_SINGLE_PUT_CHAR(12,gc->state.storePack.swapEndian);
+ __GLX_SINGLE_PUT_CHAR(12,state->storePack.swapEndian);
__GLX_SINGLE_PUT_CHAR(13,reset);
__GLX_SINGLE_READ_XREPLY();
compsize = (long)reply.length << 2;
@@ -360,18 +372,20 @@
GLvoid *values)
{
__GLX_SINGLE_DECLARE_VARIABLES();
+ const __GLXattribute * state;
xGLXGetMinmaxReply reply;
GLubyte *buf;
if (!dpy) return;
__GLX_SINGLE_LOAD_VARIABLES();
+ state = gc->client_state_private;
/* Send request */
__GLX_SINGLE_BEGIN(X_GLsop_GetMinmax,__GLX_PAD(14));
__GLX_SINGLE_PUT_LONG(0,(long)target);
__GLX_SINGLE_PUT_LONG(4,(long)format);
__GLX_SINGLE_PUT_LONG(8,(long)type);
- __GLX_SINGLE_PUT_CHAR(12,gc->state.storePack.swapEndian);
+ __GLX_SINGLE_PUT_CHAR(12,state->storePack.swapEndian);
__GLX_SINGLE_PUT_CHAR(13,reset);
__GLX_SINGLE_READ_XREPLY();
compsize = (long)reply.length << 2;
Index: size.h
===================================================================
RCS file: /cvs/xorg/xc/lib/GL/glx/size.h,v
retrieving revision 1.1.4.1
retrieving revision 1.1.4.2
diff -u -d -r1.1.4.1 -r1.1.4.2
--- a/size.h 26 Nov 2003 22:48:31 -0000 1.1.4.1
+++ b/size.h 23 Feb 2004 21:33:57 -0000 1.1.4.2
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/glx/size.h,v 1.4 2003/09/28 20:15:04 alanh Exp $ */
+/* $XFree86: xc/lib/GL/glx/size.h,v 1.5 2004/01/28 18:11:43 alanh Exp $ */
#ifndef _size_h_
#define _size_h_
@@ -67,5 +67,6 @@
extern GLint __glTexParameterfv_size(GLenum e);
extern GLint __glTexParameteriv_size(GLenum e);
extern GLint __glPointParameterfvARB_size(GLenum e);
+extern GLint __glPointParameteriv_size(GLenum e);
#endif /* _size_h_ */
Index: vertarr.c
===================================================================
RCS file: /cvs/xorg/xc/lib/GL/glx/vertarr.c,v
retrieving revision 1.1
retrieving revision 1.1.4.1
diff -u -d -r1.1 -r1.1.4.1
--- a/vertarr.c 14 Nov 2003 16:48:44 -0000 1.1
+++ b/vertarr.c 23 Feb 2004 21:33:57 -0000 1.1.4.1
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/glx/vertarr.c,v 1.4 2001/03/25 05:32:00 tsi Exp $ */
+/* $XFree86: xc/lib/GL/glx/vertarr.c,v 1.5 2004/01/28 18:11:43 alanh Exp $ */
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
@@ -64,6 +64,14 @@
colorPointer->proc = (void (*)(const void *))glColor4##let##v; \
break
+#define __GL_SEC_COLOR_FUNC(NAME, let) \
+ case GL_##NAME: \
+ seccolorPointer->proc = (void (*)(const void *))glSecondaryColor3##let##v; \
+
+#define __GL_FOG_FUNC(NAME, let) \
+ case GL_##NAME: \
+ fogPointer->proc = (void (*)(const void *))glFogCoord##let##v; \
+
#define __GL_INDEX_FUNC(NAME, let) \
case GL_##NAME: \
indexPointer->proc = (void (*)(const void *))glIndex##let##v; \
@@ -71,15 +79,19 @@
#define __GL_TEXTURE_FUNC(NAME, let) \
case GL_##NAME: \
- if (size == 1) \
+ if (size == 1) { \
texCoordPointer->proc = (void (*)(const void *))glTexCoord1##let##v; \
- else if (size == 2) \
+ texCoordPointer->mtex_proc = (void (*)(GLenum, const void *))glMultiTexCoord1##let##vARB; \
+ } else if (size == 2) { \
texCoordPointer->proc = (void (*)(const void *))glTexCoord2##let##v; \
- else if (size == 3) \
+ texCoordPointer->mtex_proc = (void (*)(GLenum, const void *))glMultiTexCoord2##let##vARB; \
+ } else if (size == 3) { \
texCoordPointer->proc = (void (*)(const void *))glTexCoord3##let##v; \
- else if (size == 4) \
+ texCoordPointer->mtex_proc = (void (*)(GLenum, const void *))glMultiTexCoord2##let##vARB; \
+ } else if (size == 4) { \
texCoordPointer->proc = (void (*)(const void *))glTexCoord4##let##v; \
- break
+ texCoordPointer->mtex_proc = (void (*)(GLenum, const void *))glMultiTexCoord4##let##vARB; \
+ } break
static GLuint __glXTypeSize(GLenum enm)
{
@@ -99,7 +111,8 @@
void __glXInitVertexArrayState(__GLXcontext *gc)
{
- __GLXvertArrayState *va = &gc->state.vertArray;
+ __GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
+ __GLXvertArrayState *va = &state->vertArray;
GLint i;
va->vertex.enable = GL_FALSE;
@@ -126,6 +139,22 @@
va->color.type = GL_FLOAT;
va->color.stride = 0;
+ va->secondaryColor.enable = GL_FALSE;
+ va->secondaryColor.proc = NULL;
+ va->secondaryColor.skip = 0;
+ va->secondaryColor.ptr = 0;
+ va->secondaryColor.size = 3;
+ va->secondaryColor.type = GL_FLOAT;
+ va->secondaryColor.stride = 0;
+
+ va->fogCoord.enable = GL_FALSE;
+ va->fogCoord.proc = NULL;
+ va->fogCoord.skip = 0;
+ va->fogCoord.ptr = 0;
+ va->fogCoord.size = 1;
+ va->fogCoord.type = GL_FLOAT;
+ va->fogCoord.stride = 0;
+
va->index.enable = GL_FALSE;
va->index.proc = NULL;
va->index.skip = 0;
@@ -164,7 +193,8 @@
const GLvoid *pointer)
{
__GLXcontext *gc = __glXGetCurrentContext();
- __GLXvertexArrayPointerState *vertexPointer = &gc->state.vertArray.vertex;
+ __GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
+ __GLXvertexArrayPointerState *vertexPointer = &state->vertArray.vertex;
/* Check arguments */
if (size < 2 || size > 4 || stride < 0) {
@@ -199,7 +229,8 @@
void glNormalPointer(GLenum type, GLsizei stride, const GLvoid *pointer)
{
__GLXcontext *gc = __glXGetCurrentContext();
- __GLXvertexArrayPointerState *normalPointer = &gc->state.vertArray.normal;
+ __GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
+ __GLXvertexArrayPointerState *normalPointer = &state->vertArray.normal;
/* Check arguments */
if (stride < 0) {
@@ -235,7 +266,8 @@
const GLvoid *pointer)
{
__GLXcontext *gc = __glXGetCurrentContext();
- __GLXvertexArrayPointerState *colorPointer = &gc->state.vertArray.color;
+ __GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
+ __GLXvertexArrayPointerState *colorPointer = &state->vertArray.color;
/* Check arguments */
if (stride < 0) {
@@ -274,7 +306,8 @@
void glIndexPointer(GLenum type, GLsizei stride, const GLvoid *pointer)
{
__GLXcontext *gc = __glXGetCurrentContext();
- __GLXvertexArrayPointerState *indexPointer = &gc->state.vertArray.index;
+ __GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
+ __GLXvertexArrayPointerState *indexPointer = &state->vertArray.index;
/* Check arguments */
if (stride < 0) {
@@ -310,8 +343,9 @@
const GLvoid *pointer)
{
__GLXcontext *gc = __glXGetCurrentContext();
+ __GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
__GLXvertexArrayPointerState *texCoordPointer =
- &gc->state.vertArray.texCoord[gc->state.vertArray.activeTexture];
+ &state->vertArray.texCoord[state->vertArray.activeTexture];
/* Check arguments */
if (size < 1 || size > 4 || stride < 0) {
@@ -346,7 +380,8 @@
void glEdgeFlagPointer(GLsizei stride, const GLvoid *pointer)
{
__GLXcontext *gc = __glXGetCurrentContext();
- __GLXvertexArrayPointerState *edgeFlagPointer = &gc->state.vertArray.edgeFlag;
+ __GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
+ __GLXvertexArrayPointerState *edgeFlagPointer = &state->vertArray.edgeFlag;
/* Check arguments */
if (stride < 0) {
@@ -369,6 +404,81 @@
}
+void glSecondaryColorPointer(GLint size, GLenum type, GLsizei stride,
+ const GLvoid * pointer )
+{
+ __GLXcontext *gc = __glXGetCurrentContext();
+ __GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
+ __GLXvertexArrayPointerState *seccolorPointer = &state->vertArray.secondaryColor;
+
+ /* Check arguments */
+ if ( (stride < 0) || (size != 3) ) {
+ __glXSetError(gc, GL_INVALID_VALUE);
+ return;
+ }
+
+ /* Choose appropriate api proc */
+ switch(type) {
+ __GL_SEC_COLOR_FUNC(BYTE, b);
+ __GL_SEC_COLOR_FUNC(UNSIGNED_BYTE, ub);
+ __GL_SEC_COLOR_FUNC(SHORT, s);
+ __GL_SEC_COLOR_FUNC(UNSIGNED_SHORT, us);
+ __GL_SEC_COLOR_FUNC(INT, i);
+ __GL_SEC_COLOR_FUNC(UNSIGNED_INT, ui);
+ __GL_SEC_COLOR_FUNC(FLOAT, f);
+ __GL_SEC_COLOR_FUNC(DOUBLE, d);
+ default:
+ __glXSetError(gc, GL_INVALID_ENUM);
+ return;
+ }
+
+ seccolorPointer->size = size;
+ seccolorPointer->type = type;
+ seccolorPointer->stride = stride;
+ seccolorPointer->ptr = pointer;
+
+ /* Set internal state */
+ if (stride == 0) {
+ seccolorPointer->skip = size * __glXTypeSize(type);
+ } else {
+ seccolorPointer->skip = stride;
+ }
+}
+
+void glFogCoordPointer(GLenum type, GLsizei stride, const GLvoid * pointer)
+{
+ __GLXcontext *gc = __glXGetCurrentContext();
+ __GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
+ __GLXvertexArrayPointerState *fogPointer = &state->vertArray.fogCoord;
+
+ /* Check arguments */
+ if (stride < 0) {
+ __glXSetError(gc, GL_INVALID_VALUE);
+ return;
+ }
+
+ /* Choose appropriate api proc */
+ switch(type) {
+ __GL_FOG_FUNC(FLOAT, f);
+ __GL_FOG_FUNC(DOUBLE, d);
+ default:
+ __glXSetError(gc, GL_INVALID_ENUM);
+ return;
+ }
+
+ fogPointer->size = 1;
+ fogPointer->type = type;
+ fogPointer->stride = stride;
+ fogPointer->ptr = pointer;
+
+ /* Set internal state */
+ if (stride == 0) {
+ fogPointer->skip = __glXTypeSize(type);
+ } else {
+ fogPointer->skip = stride;
+ }
+}
+
void glInterleavedArrays(GLenum format, GLsizei stride, const GLvoid *pointer)
{
__GLXcontext *gc = __glXGetCurrentContext();
@@ -506,6 +616,8 @@
trueStride = (stride == 0) ? size : stride;
+ glDisableClientState(GL_SECONDARY_COLOR_ARRAY);
+ glDisableClientState(GL_FOG_COORDINATE_ARRAY);
glDisableClientState(GL_EDGE_FLAG_ARRAY);
glDisableClientState(GL_INDEX_ARRAY);
if (tEnable) {
@@ -535,7 +647,8 @@
void glArrayElement(GLint i)
{
__GLXcontext *gc = __glXGetCurrentContext();
- __GLXvertArrayState *va = &gc->state.vertArray;
+ __GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
+ __GLXvertArrayState *va = &state->vertArray;
GLint j;
if (va->edgeFlag.enable == GL_TRUE) {
@@ -552,6 +665,10 @@
(*va->color.proc)(va->color.ptr+i*va->color.skip);
}
+ if (va->secondaryColor.enable == GL_TRUE) {
+ (*va->secondaryColor.proc)(va->secondaryColor.ptr+i*va->secondaryColor.skip);
+ }
+
if (va->index.enable == GL_TRUE) {
(*va->index.proc)(va->index.ptr+i*va->index.skip);
}
@@ -560,6 +677,10 @@
(*va->normal.proc)(va->normal.ptr+i*va->normal.skip);
}
+ if (va->fogCoord.enable == GL_TRUE) {
+ (*va->fogCoord.proc)(va->fogCoord.ptr+i*va->fogCoord.skip);
+ }
+
if (va->vertex.enable == GL_TRUE) {
(*va->vertex.proc)(va->vertex.ptr+i*va->vertex.skip);
}
@@ -568,8 +689,10 @@
void glDrawArrays(GLenum mode, GLint first, GLsizei count)
{
__GLXcontext *gc = __glXGetCurrentContext();
- __GLXvertArrayState *va = &gc->state.vertArray;
- const GLubyte *vaPtr = NULL, *naPtr = NULL, *caPtr = NULL,
+ __GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
+ __GLXvertArrayState *va = &state->vertArray;
+ const GLubyte *vaPtr = NULL, *naPtr = NULL, *caPtr = NULL,
+ *scaPtr = NULL, *faPtr = NULL,
*iaPtr = NULL, *tcaPtr[__GLX_MAX_TEXTURE_UNITS];
const GLboolean *efaPtr = NULL;
GLint i, j;
@@ -603,6 +726,10 @@
naPtr = va->normal.ptr + first * va->normal.skip;
if (va->color.enable == GL_TRUE)
caPtr = va->color.ptr + first * va->color.skip;
+ if (va->secondaryColor.enable == GL_TRUE)
+ scaPtr = va->secondaryColor.ptr + first * va->secondaryColor.skip;
+ if (va->fogCoord.enable == GL_TRUE)
+ faPtr = va->fogCoord.ptr + first * va->fogCoord.skip;
if (va->index.enable == GL_TRUE)
iaPtr = va->index.ptr + first * va->index.skip;
for (j=0; j<__GLX_MAX_TEXTURE_UNITS; ++j) {
@@ -620,16 +747,35 @@
(*va->edgeFlag.proc)(efaPtr);
efaPtr += va->edgeFlag.skip;
}
- for (j=0; j<__GLX_MAX_TEXTURE_UNITS; ++j) {
+
+
+ if (va->texCoord[0].enable == GL_TRUE) {
+ (*va->texCoord[0].proc)(tcaPtr[0]);
+ tcaPtr[0] += va->texCoord[0].skip;
+ }
+
+ /* Multitexturing is handled specially because the protocol
+ * requires an extra parameter.
+ */
+ for (j=1; j<__GLX_MAX_TEXTURE_UNITS; ++j) {
if (va->texCoord[j].enable == GL_TRUE) {
- (*va->texCoord[j].proc)(tcaPtr[j]);
+ (*va->texCoord[j].mtex_proc)(GL_TEXTURE0 + j, tcaPtr[j]);
tcaPtr[j] += va->texCoord[j].skip;
}
}
+
if (va->color.enable == GL_TRUE) {
(*va->color.proc)(caPtr);
caPtr += va->color.skip;
}
+ if (va->secondaryColor.enable == GL_TRUE) {
+ (*va->secondaryColor.proc)(scaPtr);
+ scaPtr += va->secondaryColor.skip;
+ }
+ if (va->fogCoord.enable == GL_TRUE) {
+ (*va->fogCoord.proc)(faPtr);
+ faPtr += va->fogCoord.skip;
+ }
if (va->index.enable == GL_TRUE) {
(*va->index.proc)(iaPtr);
iaPtr += va->index.skip;
@@ -650,7 +796,8 @@
const GLvoid *indices)
{
__GLXcontext *gc = __glXGetCurrentContext();
- __GLXvertArrayState *va = &gc->state.vertArray;
+ __GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
+ __GLXvertArrayState *va = &state->vertArray;
const GLubyte *iPtr1 = NULL;
const GLushort *iPtr2 = NULL;
const GLuint *iPtr3 = NULL;
@@ -745,14 +892,40 @@
glDrawElements(mode,count,type,indices);
}
+void glMultiDrawArrays(GLenum mode, GLint *first, GLsizei *count,
+ GLsizei primcount)
+{
+ GLsizei i;
+
+ for(i=0; i<primcount; i++) {
+ if ( count[i] > 0 ) {
+ glDrawArrays( mode, first[i], count[i] );
+ }
+ }
+}
+
+void glMultiDrawElements(GLenum mode, const GLsizei *count,
+ GLenum type, const GLvoid ** indices,
+ GLsizei primcount)
+{
+ GLsizei i;
+
+ for(i=0; i<primcount; i++) {
+ if ( count[i] > 0 ) {
+ glDrawElements( mode, count[i], type, indices[i] );
+ }
+ }
+}
+
void glClientActiveTextureARB(GLenum texture)
{
__GLXcontext *gc = __glXGetCurrentContext();
+ __GLXattribute * state = (__GLXattribute *)(gc->client_state_private);
GLint unit = (GLint) texture - GL_TEXTURE0_ARB;
if (unit < 0 || __GLX_MAX_TEXTURE_UNITS <= unit) {
__glXSetError(gc, GL_INVALID_ENUM);
return;
}
- gc->state.vertArray.activeTexture = unit;
+ state->vertArray.activeTexture = unit;
}
More information about the xorg-commit
mailing list