drivers can report non-default numbers of lights and clip planes.
-/* $Id: clip.c,v 1.17 2000/11/24 10:25:05 keithw Exp $ */
+/* $Id: clip.c,v 1.18 2000/11/27 18:22:13 brianp Exp $ */
/*
* Mesa 3-D graphics library
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glClipPlane");
p = (GLint) plane - (GLint) GL_CLIP_PLANE0;
- if (p<0 || p>=MAX_CLIP_PLANES) {
+ if (p < 0 || p >= ctx->Const.MaxClipPlanes) {
gl_error( ctx, GL_INVALID_ENUM, "glClipPlane" );
return;
}
p = (GLint) (plane - GL_CLIP_PLANE0);
- if (p<0 || p>=MAX_CLIP_PLANES) {
+ if (p < 0 || p >= ctx->Const.MaxClipPlanes) {
gl_error( ctx, GL_INVALID_ENUM, "glGetClipPlane" );
return;
}
-/* $Id: context.c,v 1.109 2000/11/24 10:25:05 keithw Exp $ */
+/* $Id: context.c,v 1.110 2000/11/27 18:22:13 brianp Exp $ */
/*
* Mesa 3-D graphics library
ctx->Const.MaxConvolutionWidth = MAX_CONVOLUTION_WIDTH;
ctx->Const.MaxConvolutionHeight = MAX_CONVOLUTION_HEIGHT;
ctx->Const.NumCompressedTextureFormats = 0;
+ ctx->Const.MaxClipPlanes = MAX_CLIP_PLANES;
+ ctx->Const.MaxLights = MAX_LIGHTS;
/* Modelview matrix */
_math_matrix_ctr( &ctx->ModelView );
-/* $Id: get.c,v 1.43 2000/11/22 07:32:17 joukj Exp $ */
+/* $Id: get.c,v 1.44 2000/11/27 18:22:13 brianp Exp $ */
/*
* Mesa 3-D graphics library
*params = INT_TO_BOOL( MAX_CLIENT_ATTRIB_STACK_DEPTH);
break;
case GL_MAX_CLIP_PLANES:
- *params = INT_TO_BOOL(MAX_CLIP_PLANES);
+ *params = INT_TO_BOOL(ctx->Const.MaxClipPlanes);
break;
case GL_MAX_ELEMENTS_VERTICES: /* GL_VERSION_1_2 */
*params = INT_TO_BOOL(VB_MAX);
*params = INT_TO_BOOL(MAX_EVAL_ORDER);
break;
case GL_MAX_LIGHTS:
- *params = INT_TO_BOOL(MAX_LIGHTS);
+ *params = INT_TO_BOOL(ctx->Const.MaxLights);
break;
case GL_MAX_LIST_NESTING:
*params = INT_TO_BOOL(MAX_LIST_NESTING);
*params = (GLdouble) MAX_CLIENT_ATTRIB_STACK_DEPTH;
break;
case GL_MAX_CLIP_PLANES:
- *params = (GLdouble) MAX_CLIP_PLANES;
+ *params = (GLdouble) ctx->Const.MaxClipPlanes;
break;
case GL_MAX_ELEMENTS_VERTICES: /* GL_VERSION_1_2 */
*params = (GLdouble) VB_MAX;
*params = (GLdouble) MAX_EVAL_ORDER;
break;
case GL_MAX_LIGHTS:
- *params = (GLdouble) MAX_LIGHTS;
+ *params = (GLdouble) ctx->Const.MaxLights;
break;
case GL_MAX_LIST_NESTING:
*params = (GLdouble) MAX_LIST_NESTING;
*params = (GLfloat) MAX_CLIENT_ATTRIB_STACK_DEPTH;
break;
case GL_MAX_CLIP_PLANES:
- *params = (GLfloat) MAX_CLIP_PLANES;
+ *params = (GLfloat) ctx->Const.MaxClipPlanes;
break;
case GL_MAX_ELEMENTS_VERTICES: /* GL_VERSION_1_2 */
*params = (GLfloat) VB_MAX;
*params = (GLfloat) MAX_EVAL_ORDER;
break;
case GL_MAX_LIGHTS:
- *params = (GLfloat) MAX_LIGHTS;
+ *params = (GLfloat) ctx->Const.MaxLights;
break;
case GL_MAX_LIST_NESTING:
*params = (GLfloat) MAX_LIST_NESTING;
*params = (GLint) MAX_CLIENT_ATTRIB_STACK_DEPTH;
break;
case GL_MAX_CLIP_PLANES:
- *params = (GLint) MAX_CLIP_PLANES;
+ *params = (GLint) ctx->Const.MaxClipPlanes;
break;
case GL_MAX_ELEMENTS_VERTICES: /* GL_VERSION_1_2 */
*params = VB_MAX;
*params = (GLint) MAX_EVAL_ORDER;
break;
case GL_MAX_LIGHTS:
- *params = (GLint) MAX_LIGHTS;
+ *params = (GLint) ctx->Const.MaxLights;
break;
case GL_MAX_LIST_NESTING:
*params = (GLint) MAX_LIST_NESTING;
-/* $Id: light.c,v 1.29 2000/11/24 15:21:59 keithw Exp $ */
+/* $Id: light.c,v 1.30 2000/11/27 18:22:13 brianp Exp $ */
/*
* Mesa 3-D graphics library
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glLight");
- if (i < 0 || i >= MAX_LIGHTS) {
+ if (i < 0 || i >= ctx->Const.MaxLights) {
gl_error( ctx, GL_INVALID_ENUM, "glLight" );
return;
}
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glGetLight");
- if (l<0 || l>=MAX_LIGHTS) {
+ if (l < 0 || l >= ctx->Const.MaxLights) {
gl_error( ctx, GL_INVALID_ENUM, "glGetLightfv" );
return;
}
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glGetLight");
- if (l<0 || l>=MAX_LIGHTS) {
+ if (l < 0 || l >= ctx->Const.MaxLights) {
gl_error( ctx, GL_INVALID_ENUM, "glGetLightiv" );
return;
}
-/* $Id: mtypes.h,v 1.2 2000/11/24 10:25:05 keithw Exp $ */
+/* $Id: mtypes.h,v 1.3 2000/11/27 18:22:13 brianp Exp $ */
/*
* Mesa 3-D graphics library
GLuint MaxConvolutionHeight;
GLuint NumCompressedTextureFormats; /* GL_ARB_texture_compression */
GLenum CompressedTextureFormats[MAX_COMPRESSED_TEXTURE_FORMATS];
+ GLuint MaxClipPlanes;
+ GLuint MaxLights;
};
-/* $Id: rastpos.c,v 1.16 2000/11/24 10:25:05 keithw Exp $ */
+/* $Id: rastpos.c,v 1.17 2000/11/27 18:22:13 brianp Exp $ */
/*
* Mesa 3-D graphics library
{
GLuint p;
- for (p=0;p<MAX_CLIP_PLANES;p++) {
+ for (p = 0; p < ctx->Const.MaxClipPlanes; p++) {
if (ctx->Transform.ClipEnabled[p]) {
GLfloat dot = v[0] * ctx->Transform._ClipUserPlane[p][0]
+ v[1] * ctx->Transform._ClipUserPlane[p][1]
-/* $Id: state.c,v 1.48 2000/11/24 10:25:06 keithw Exp $ */
+/* $Id: state.c,v 1.49 2000/11/27 18:22:13 brianp Exp $ */
/*
* Mesa 3-D graphics library
*/
if (ctx->Transform._AnyClip) {
GLuint p;
- for (p = 0 ; p < MAX_CLIP_PLANES ; p++) {
+ for (p = 0; p < ctx->Const.MaxClipPlanes; p++) {
if (ctx->Transform.ClipEnabled[p]) {
gl_transform_vector( ctx->Transform._ClipUserPlane[p],
ctx->Transform.EyeUserPlane[p],