From 0b26e826bda0da7aeec9a79ee07fe21d54bb1263 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 22 Oct 2006 17:18:50 +0000 Subject: Color clamping fixes. --- src/mesa/main/blend.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'src/mesa/main/blend.c') 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 */ /*@{*/ -- cgit v1.2.3