<param name="param" type="GLtype"/>
</vector>
</proto>
-
- <desc name="pname">
- <value name="GL_LIGHT_MODEL_AMBIENT"/>
-
- <desc name="params" vector_size="4"/>
- </desc>
-
- <desc name="pname">
- <value name="GL_LIGHT_MODEL_TWO_SIDE"/>
- <desc name="param">
- <value name="GL_TRUE"/>
- <value name="GL_FALSE"/>
- </desc>
- </desc>
</template>
<template name="LineWidth">
void GL_APIENTRY
_es_LightModelx(GLenum pname, GLfixed param)
{
- switch(pname) {
- case GL_LIGHT_MODEL_TWO_SIDE:
- if (param != GL_TRUE && param != GL_FALSE) {
- _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM,
- "glLightModelx(pname=0x%x)", pname);
- return;
- }
- break;
- default:
- _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM,
- "glLightModelx(pname=0x%x)", pname);
- return;
- }
-
_mesa_LightModelf(pname, (GLfloat) param);
}
n_params = 4;
break;
case GL_LIGHT_MODEL_TWO_SIDE:
- if (params[0] != GL_TRUE && params[0] != GL_FALSE) {
- _mesa_error(_mesa_get_current_context(), GL_INVALID_ENUM,
- "glLightModelxv(pname=0x%x)", pname);
- return;
- }
convert_params_value = false;
n_params = 1;
break;
COPY_4V( ctx->Light.Model.Ambient, params );
break;
case GL_LIGHT_MODEL_LOCAL_VIEWER:
+ if (ctx->API != API_OPENGL)
+ goto invalid_pname;
newbool = (params[0]!=0.0);
if (ctx->Light.Model.LocalViewer == newbool)
return;
ctx->_TriangleCaps &= ~DD_TRI_LIGHT_TWOSIDE;
break;
case GL_LIGHT_MODEL_COLOR_CONTROL:
+ if (ctx->API != API_OPENGL)
+ goto invalid_pname;
if (params[0] == (GLfloat) GL_SINGLE_COLOR)
newenum = GL_SINGLE_COLOR;
else if (params[0] == (GLfloat) GL_SEPARATE_SPECULAR_COLOR)
ctx->Light.Model.ColorControl = newenum;
break;
default:
- _mesa_error( ctx, GL_INVALID_ENUM, "glLightModel(pname=0x%x)", pname );
- break;
+ goto invalid_pname;
}
if (ctx->Driver.LightModelfv)
ctx->Driver.LightModelfv( ctx, pname, params );
+
+ return;
+
+invalid_pname:
+ _mesa_error( ctx, GL_INVALID_ENUM, "glLightModel(pname=0x%x)", pname );
+ return;
}