summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/fog.c
diff options
context:
space:
mode:
authorNicholas Miell <[email protected]>2011-09-19 23:16:59 -0700
committerMarek Olšák <[email protected]>2011-11-01 11:37:10 +0100
commit740467dd62962b4effdaf51e38edc032e2a39487 (patch)
treea0b9df048ac58d99574fbb5423a327946a02b46f /src/mesa/main/fog.c
parent7f08248c2e2d7e862e88db2d0008efca3c276512 (diff)
mesa: Add the basics for the NV_fog_distance extension
No driver implements it yet.
Diffstat (limited to 'src/mesa/main/fog.c')
-rw-r--r--src/mesa/main/fog.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/mesa/main/fog.c b/src/mesa/main/fog.c
index 88aa31a7fcb..d65add9302d 100644
--- a/src/mesa/main/fog.c
+++ b/src/mesa/main/fog.c
@@ -172,6 +172,19 @@ _mesa_Fogfv( GLenum pname, const GLfloat *params )
ctx->Fog.FogCoordinateSource = p;
break;
}
+ case GL_FOG_DISTANCE_MODE_NV: {
+ GLenum p = (GLenum) (GLint) *params;
+ if (!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;
+ }
+ if (ctx->Fog.FogDistanceMode == p)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_FOG);
+ ctx->Fog.FogDistanceMode = p;
+ break;
+ }
default:
_mesa_error( ctx, GL_INVALID_ENUM, "glFog" );
return;
@@ -201,4 +214,5 @@ void _mesa_init_fog( struct gl_context * ctx )
ctx->Fog.ColorSumEnabled = GL_FALSE;
ctx->Fog.FogCoordinateSource = GL_FRAGMENT_DEPTH_EXT;
ctx->Fog._Scale = 1.0f;
+ ctx->Fog.FogDistanceMode = GL_EYE_PLANE_ABSOLUTE_NV;
}