diff options
author | Brian Paul <[email protected]> | 2002-10-04 19:10:06 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2002-10-04 19:10:06 +0000 |
commit | fc80ad6e62fb2b53d53756593099330477a44c52 (patch) | |
tree | 0b47f3ee84d613dfa2264d6f23e5c2a60cecc9ba /src/mesa/drivers/x11/xm_dd.c | |
parent | f782b8189e718974a40d72ac4f6b8d213ca99e1e (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/drivers/x11/xm_dd.c')
-rw-r--r-- | src/mesa/drivers/x11/xm_dd.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/mesa/drivers/x11/xm_dd.c b/src/mesa/drivers/x11/xm_dd.c index 3d4792737ca..9be4aba69be 100644 --- a/src/mesa/drivers/x11/xm_dd.c +++ b/src/mesa/drivers/x11/xm_dd.c @@ -1,4 +1,4 @@ -/* $Id: xm_dd.c,v 1.36 2002/09/27 02:45:39 brianp Exp $ */ +/* $Id: xm_dd.c,v 1.37 2002/10/04 19:10:12 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -27,6 +27,7 @@ #include "glxheader.h" #include "context.h" +#include "colormac.h" #include "depth.h" #include "drawpix.h" #include "extensions.h" @@ -176,15 +177,18 @@ clear_index( GLcontext *ctx, GLuint index ) static void -clear_color( GLcontext *ctx, const GLchan color[4] ) +clear_color( GLcontext *ctx, const GLfloat color[4] ) { const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx; - xmesa->clearcolor[0] = color[0]; - xmesa->clearcolor[1] = color[1]; - xmesa->clearcolor[2] = color[2]; - xmesa->clearcolor[3] = color[3]; - xmesa->clearpixel = xmesa_color_to_pixel( xmesa, color[0], color[1], - color[2], color[3], + CLAMPED_FLOAT_TO_UBYTE(xmesa->clearcolor[0], color[0]); + CLAMPED_FLOAT_TO_UBYTE(xmesa->clearcolor[1], color[1]); + CLAMPED_FLOAT_TO_UBYTE(xmesa->clearcolor[2], color[2]); + CLAMPED_FLOAT_TO_UBYTE(xmesa->clearcolor[3], color[3]); + xmesa->clearpixel = xmesa_color_to_pixel( xmesa, + xmesa->clearcolor[0], + xmesa->clearcolor[1], + xmesa->clearcolor[2], + xmesa->clearcolor[3], xmesa->xm_visual->undithered_pf ); _glthread_LOCK_MUTEX(_xmesa_lock); XMesaSetForeground( xmesa->display, xmesa->xm_draw_buffer->cleargc, |