summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/buffers.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2002-10-04 19:10:06 +0000
committerBrian Paul <[email protected]>2002-10-04 19:10:06 +0000
commitfc80ad6e62fb2b53d53756593099330477a44c52 (patch)
tree0b47f3ee84d613dfa2264d6f23e5c2a60cecc9ba /src/mesa/main/buffers.c
parentf782b8189e718974a40d72ac4f6b8d213ca99e1e (diff)
Changed a number of context fields from GLchan to GLfloat (such as ClearColor).
Also changed parameter types for some driver functions (like ctx->Driver.Clear- Color). Updated all the device drivers. Someday, we want to support 8, 16 and 32-bit channels dynamically at runtime.
Diffstat (limited to 'src/mesa/main/buffers.c')
-rw-r--r--src/mesa/main/buffers.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c
index 04a490ada5d..20a1c2ee22f 100644
--- a/src/mesa/main/buffers.c
+++ b/src/mesa/main/buffers.c
@@ -1,4 +1,4 @@
-/* $Id: buffers.c,v 1.37 2002/07/09 01:22:50 brianp Exp $ */
+/* $Id: buffers.c,v 1.38 2002/10/04 19:10:07 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -67,20 +67,20 @@ _mesa_ClearIndex( GLfloat c )
void
_mesa_ClearColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha )
{
- GLchan tmp[4];
+ GLfloat tmp[4];
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END(ctx);
- UNCLAMPED_FLOAT_TO_CHAN(tmp[0], red);
- UNCLAMPED_FLOAT_TO_CHAN(tmp[1], green);
- UNCLAMPED_FLOAT_TO_CHAN(tmp[2], blue);
- UNCLAMPED_FLOAT_TO_CHAN(tmp[3], alpha);
+ tmp[0] = CLAMP(red, 0.0F, 1.0F);
+ tmp[1] = CLAMP(green, 0.0F, 1.0F);
+ tmp[2] = CLAMP(blue, 0.0F, 1.0F);
+ tmp[3] = CLAMP(alpha, 0.0F, 1.0F);
if (TEST_EQ_4V(tmp, ctx->Color.ClearColor))
- return;
+ return; /* no change */
FLUSH_VERTICES(ctx, _NEW_COLOR);
- COPY_CHAN4(ctx->Color.ClearColor, tmp);
+ COPY_4V(ctx->Color.ClearColor, tmp);
if (ctx->Visual.rgbMode && ctx->Driver.ClearColor) {
/* it's OK to call glClearColor in CI mode but it should be a NOP */