-/* $Id: api_noop.c,v 1.12 2003/03/01 01:50:20 brianp Exp $ */
+/* $Id: api_noop.c,v 1.13 2003/05/30 21:37:14 idr Exp $ */
/*
* Mesa 3-D graphics library
COPY_4FV( mat[1].Emission, params );
}
if (bitmask & FRONT_SHININESS_BIT) {
- GLfloat shininess = CLAMP( params[0], 0.0F, 128.0F );
+ GLfloat shininess = CLAMP( params[0], 0.0F, ctx->Const.MaxShininess );
mat[0].Shininess = shininess;
}
if (bitmask & BACK_SHININESS_BIT) {
- GLfloat shininess = CLAMP( params[0], 0.0F, 128.0F );
+ GLfloat shininess = CLAMP( params[0], 0.0F, ctx->Const.MaxShininess );
mat[1].Shininess = shininess;
}
if (bitmask & FRONT_INDEXES_BIT) {
ctx->Const.MaxConvolutionHeight = MAX_CONVOLUTION_HEIGHT;
ctx->Const.MaxClipPlanes = MAX_CLIP_PLANES;
ctx->Const.MaxLights = MAX_LIGHTS;
+ ctx->Const.MaxSpotExponent = 128.0;
+ ctx->Const.MaxShininess = 128.0;
#if FEATURE_ARB_vertex_program
ctx->Const.MaxVertexProgramInstructions = MAX_NV_VERTEX_PROGRAM_INSTRUCTIONS;
ctx->Const.MaxVertexProgramAttribs = MAX_NV_VERTEX_PROGRAM_INPUTS;
{ OFF, "GL_MESA_ycbcr_texture", F(MESA_ycbcr_texture) },
{ ON, "GL_MESA_window_pos", F(MESA_window_pos) },
{ OFF, "GL_NV_blend_square", F(NV_blend_square) },
+ { ON, "GL_NV_light_max_exponent", F(NV_light_max_exponent) },
{ OFF, "GL_NV_point_sprite", F(NV_point_sprite) },
{ OFF, "GL_NV_texture_rectangle", F(NV_texture_rectangle) },
{ ON, "GL_NV_texgen_reflection", F(NV_texgen_reflection) },
"GL_MESA_resize_buffers",
"GL_MESA_ycbcr_texture",
"GL_NV_blend_square",
+ "GL_NV_light_max_exponent",
"GL_NV_point_sprite",
"GL_NV_texture_rectangle",
"GL_NV_texgen_reflection",
*params = ENUM_TO_BOOL(ctx->Stencil.ActiveFace ? GL_BACK : GL_FRONT);
break;
+ /* GL_NV_light_max_exponent */
+ case GL_MAX_SHININESS_NV:
+ CHECK_EXTENSION_B(NV_light_max_exponent, pname);
+ *params = FLOAT_TO_BOOL(ctx->Const.MaxShininess);
+ break;
+ case GL_MAX_SPOT_EXPONENT_NV:
+ CHECK_EXTENSION_B(NV_light_max_exponent, pname);
+ *params = FLOAT_TO_BOOL(ctx->Const.MaxSpotExponent);
+ break;
+
#if FEATURE_ARB_vertex_buffer_object
case GL_ARRAY_BUFFER_BINDING_ARB:
CHECK_EXTENSION_B(ARB_vertex_buffer_object, pname);
*params = (GLdouble) (ctx->Stencil.ActiveFace ? GL_BACK : GL_FRONT);
break;
+ /* GL_NV_light_max_exponent */
+ case GL_MAX_SHININESS_NV:
+ CHECK_EXTENSION_B(NV_light_max_exponent, pname);
+ *params = (GLdouble) ctx->Const.MaxShininess;
+ break;
+ case GL_MAX_SPOT_EXPONENT_NV:
+ CHECK_EXTENSION_B(NV_light_max_exponent, pname);
+ *params = (GLdouble) ctx->Const.MaxSpotExponent;
+ break;
+
#if FEATURE_ARB_vertex_buffer_object
case GL_ARRAY_BUFFER_BINDING_ARB:
CHECK_EXTENSION_D(ARB_vertex_buffer_object, pname);
*params = (GLfloat) (ctx->Stencil.ActiveFace ? GL_BACK : GL_FRONT);
break;
+ /* GL_NV_light_max_exponent */
+ case GL_MAX_SHININESS_NV:
+ CHECK_EXTENSION_B(NV_light_max_exponent, pname);
+ *params = ctx->Const.MaxShininess;
+ break;
+ case GL_MAX_SPOT_EXPONENT_NV:
+ CHECK_EXTENSION_B(NV_light_max_exponent, pname);
+ *params = ctx->Const.MaxSpotExponent;
+ break;
+
#if FEATURE_ARB_vertex_buffer_object
case GL_ARRAY_BUFFER_BINDING_ARB:
CHECK_EXTENSION_F(ARB_vertex_buffer_object, pname);
*params = (GLint) (ctx->Stencil.ActiveFace ? GL_BACK : GL_FRONT);
break;
+ /* GL_NV_light_max_exponent */
+ case GL_MAX_SHININESS_NV:
+ CHECK_EXTENSION_B(NV_light_max_exponent, pname);
+ *params = (GLint) ctx->Const.MaxShininess;
+ break;
+ case GL_MAX_SPOT_EXPONENT_NV:
+ CHECK_EXTENSION_B(NV_light_max_exponent, pname);
+ *params = (GLint) ctx->Const.MaxSpotExponent;
+ break;
+
#if FEATURE_ARB_vertex_buffer_object
case GL_ARRAY_BUFFER_BINDING_ARB:
CHECK_EXTENSION_I(ARB_vertex_buffer_object, pname);
-/* $Id: light.c,v 1.55 2003/03/01 01:50:21 brianp Exp $ */
+/* $Id: light.c,v 1.56 2003/05/30 21:37:19 idr Exp $ */
/*
* Mesa 3-D graphics library
break;
}
case GL_SPOT_EXPONENT:
- if (params[0]<0.0 || params[0]>128.0) {
+ if (params[0]<0.0 || params[0]>ctx->Const.MaxSpotExponent) {
_mesa_error( ctx, GL_INVALID_VALUE, "glLight" );
return;
}
GLuint MaxConvolutionHeight;
GLuint MaxClipPlanes;
GLuint MaxLights;
+ GLfloat MaxShininess; /* GL_NV_light_max_exponent */
+ GLfloat MaxSpotExponent; /* GL_NV_light_max_exponent */
/* GL_ARB_vertex_program */
GLuint MaxVertexProgramInstructions;
GLuint MaxVertexProgramAttribs;
GLboolean MESA_ycbcr_texture;
GLboolean NV_blend_square;
GLboolean NV_fragment_program;
+ GLboolean NV_light_max_exponent;
GLboolean NV_point_sprite;
GLboolean NV_texture_rectangle;
GLboolean NV_texgen_reflection;
COPY_4FV( mat[1].Emission, params );
}
if (bitmask & FRONT_SHININESS_BIT) {
- GLfloat shininess = CLAMP( params[0], 0.0F, 128.0F );
+ GLfloat shininess = CLAMP( params[0], 0.0F, ctx->Const.MaxShininess );
mat[0].Shininess = shininess;
}
if (bitmask & BACK_SHININESS_BIT) {
- GLfloat shininess = CLAMP( params[0], 0.0F, 128.0F );
+ GLfloat shininess = CLAMP( params[0], 0.0F, ctx->Const.MaxShininess );
mat[1].Shininess = shininess;
}
if (bitmask & FRONT_INDEXES_BIT) {