summaryrefslogtreecommitdiff
path: root/src/mesa/main/blend.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2006-10-22 17:18:50 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2006-10-22 17:18:50 +0000
commit0b26e826bda0da7aeec9a79ee07fe21d54bb1263 (patch)
treecad7fe6571832fc55e6916f024aa1d1365ea410f /src/mesa/main/blend.c
parent919cd2c3ba39bf4d8d2ffcea0daec7bab8645d34 (diff)
Color clamping fixes.
Diffstat (limited to 'src/mesa/main/blend.c')
-rw-r--r--src/mesa/main/blend.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/mesa/main/blend.c b/src/mesa/main/blend.c
index bf886af9e8..81bd4c2f32 100644
--- a/src/mesa/main/blend.c
+++ b/src/mesa/main/blend.c
@@ -516,6 +516,37 @@ _mesa_ColorMask( GLboolean red, GLboolean green,
}
+extern void GLAPIENTRY
+_mesa_ClampColorARB(GLenum target, GLenum clamp)
+{
+ GET_CURRENT_CONTEXT(ctx);
+
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
+
+ if (clamp != GL_TRUE && clamp != GL_FALSE && clamp != GL_FIXED_ONLY_ARB) {
+ _mesa_error(ctx, GL_INVALID_ENUM, "glClampColorARB(clamp)");
+ return;
+ }
+
+ switch (target) {
+ case GL_CLAMP_VERTEX_COLOR_ARB:
+ ctx->Light.ClampVertexColor = clamp;
+ break;
+ case GL_CLAMP_FRAGMENT_COLOR_ARB:
+ ctx->Color.ClampFragmentColor = clamp;
+ break;
+ case GL_CLAMP_READ_COLOR_ARB:
+ ctx->Color.ClampReadColor = clamp;
+ break;
+ default:
+ _mesa_error(ctx, GL_INVALID_ENUM, "glClampColorARB(target)");
+ return;
+ }
+}
+
+
+
+
/**********************************************************************/
/** \name Initialization */
/*@{*/