diff options
author | Brian Paul <brian.paul@tungstengraphics.com> | 2002-10-04 19:10:06 +0000 |
---|---|---|
committer | Brian Paul <brian.paul@tungstengraphics.com> | 2002-10-04 19:10:06 +0000 |
commit | fc80ad6e62fb2b53d53756593099330477a44c52 (patch) | |
tree | 0b47f3ee84d613dfa2264d6f23e5c2a60cecc9ba /src/mesa/drivers/ggi | |
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/ggi')
-rw-r--r-- | src/mesa/drivers/ggi/ggimesa.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/mesa/drivers/ggi/ggimesa.c b/src/mesa/drivers/ggi/ggimesa.c index 6fff79648c..94364f49e4 100644 --- a/src/mesa/drivers/ggi/ggimesa.c +++ b/src/mesa/drivers/ggi/ggimesa.c @@ -96,17 +96,22 @@ static void gl_ggiSetClearIndex(GLcontext *ctx, GLuint ci) ggi_ctx->clearcolor = (ggi_pixel)ci; } -static void gl_ggiSetClearColor(GLcontext *ctx, const GLchan color[4]) +static void gl_ggiSetClearColor(GLcontext *ctx, const GLfloat color[4]) { ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx; ggi_color rgb; ggi_pixel col; - + GLubyte byteColor[3]; + GGIMESADPRINT_CORE("gl_ggiSetClearColor() called\n"); - rgb.r = (uint16)color[0] << SHIFT; - rgb.g = (uint16)color[1] << SHIFT; - rgb.b = (uint16)color[2] << SHIFT; + CLAMPED_FLOAT_TO_UBYTE(byteColor[0], color[0]); + CLAMPED_FLOAT_TO_UBYTE(byteColor[1], color[1]); + CLAMPED_FLOAT_TO_UBYTE(byteColor[2], color[2]); + + rgb.r = (uint16)byteColor[0] << SHIFT; + rgb.g = (uint16)byteColor[1] << SHIFT; + rgb.b = (uint16)byteColor[2] << SHIFT; col = ggiMapColor(ggi_ctx->ggi_visual, &rgb); ggiSetGCForeground(ggi_ctx->ggi_visual, col); ggi_ctx->clearcolor = col; |