diff options
author | Brian Paul <[email protected]> | 2006-10-22 17:18:50 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2006-10-22 17:18:50 +0000 |
commit | 0b26e826bda0da7aeec9a79ee07fe21d54bb1263 (patch) | |
tree | cad7fe6571832fc55e6916f024aa1d1365ea410f /src/mesa/main/blend.c | |
parent | 919cd2c3ba39bf4d8d2ffcea0daec7bab8645d34 (diff) |
Color clamping fixes.
Diffstat (limited to 'src/mesa/main/blend.c')
-rw-r--r-- | src/mesa/main/blend.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/mesa/main/blend.c b/src/mesa/main/blend.c index bf886af9e81..81bd4c2f320 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 */ /*@{*/ |