aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/fog.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-08-31 15:18:29 +0200
committermarha <marha@users.sourceforge.net>2012-09-04 14:23:28 +0200
commitd7fc06ac528d54e0e1416cb8aa89b6fd072400a5 (patch)
tree74cccede044412bba5723a132f1385aa9259f04b /mesalib/src/mesa/main/fog.c
parent9dec848b23cf905ded387820f2893425cc00d545 (diff)
downloadvcxsrv-d7fc06ac528d54e0e1416cb8aa89b6fd072400a5.tar.gz
vcxsrv-d7fc06ac528d54e0e1416cb8aa89b6fd072400a5.tar.bz2
vcxsrv-d7fc06ac528d54e0e1416cb8aa89b6fd072400a5.zip
randrproto xwininfo fontconfig libxcb mesa xkeyboard-config pixman xserver
git update 31 Aug 2012
Diffstat (limited to 'mesalib/src/mesa/main/fog.c')
-rw-r--r--mesalib/src/mesa/main/fog.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/mesalib/src/mesa/main/fog.c b/mesalib/src/mesa/main/fog.c
index d65add930..07405fb4b 100644
--- a/mesalib/src/mesa/main/fog.c
+++ b/mesalib/src/mesa/main/fog.c
@@ -141,6 +141,8 @@ _mesa_Fogfv( GLenum pname, const GLfloat *params )
update_fog_scale(ctx);
break;
case GL_FOG_INDEX:
+ if (ctx->API != API_OPENGL)
+ goto invalid_pname;
if (ctx->Fog.Index == *params)
return;
FLUSH_VERTICES(ctx, _NEW_FOG);
@@ -161,7 +163,7 @@ _mesa_Fogfv( GLenum pname, const GLfloat *params )
break;
case GL_FOG_COORDINATE_SOURCE_EXT: {
GLenum p = (GLenum) (GLint) *params;
- if (!ctx->Extensions.EXT_fog_coord ||
+ if (ctx->API != API_OPENGL || !ctx->Extensions.EXT_fog_coord ||
(p != GL_FOG_COORDINATE_EXT && p != GL_FRAGMENT_DEPTH_EXT)) {
_mesa_error(ctx, GL_INVALID_ENUM, "glFog");
return;
@@ -174,7 +176,7 @@ _mesa_Fogfv( GLenum pname, const GLfloat *params )
}
case GL_FOG_DISTANCE_MODE_NV: {
GLenum p = (GLenum) (GLint) *params;
- if (!ctx->Extensions.NV_fog_distance ||
+ if (ctx->API != API_OPENGL || !ctx->Extensions.NV_fog_distance ||
(p != GL_EYE_RADIAL_NV && p != GL_EYE_PLANE && p != GL_EYE_PLANE_ABSOLUTE_NV)) {
_mesa_error(ctx, GL_INVALID_ENUM, "glFog");
return;
@@ -186,13 +188,18 @@ _mesa_Fogfv( GLenum pname, const GLfloat *params )
break;
}
default:
- _mesa_error( ctx, GL_INVALID_ENUM, "glFog" );
- return;
+ goto invalid_pname;
}
if (ctx->Driver.Fogfv) {
(*ctx->Driver.Fogfv)( ctx, pname, params );
}
+
+ return;
+
+invalid_pname:
+ _mesa_error( ctx, GL_INVALID_ENUM, "glFog" );
+ return;
}