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/windows | |
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/windows')
-rw-r--r-- | src/mesa/drivers/windows/wmesa.c | 10 | ||||
-rw-r--r-- | src/mesa/drivers/windows/wmesa_stereo.c | 8 |
2 files changed, 13 insertions, 5 deletions
diff --git a/src/mesa/drivers/windows/wmesa.c b/src/mesa/drivers/windows/wmesa.c index 05029adbfea..8d59cff2039 100644 --- a/src/mesa/drivers/windows/wmesa.c +++ b/src/mesa/drivers/windows/wmesa.c @@ -1,4 +1,4 @@ -/* $Id: wmesa.c,v 1.37 2002/10/04 15:58:33 kschultz Exp $ */ +/* $Id: wmesa.c,v 1.38 2002/10/04 19:10:11 brianp Exp $ */ /* * Windows (Win32) device driver for Mesa 3.4 @@ -371,9 +371,13 @@ static void clear_index(GLcontext* ctx, GLuint index) /* * Set the color used to clear the color buffer. */ -static void clear_color( GLcontext* ctx, const GLchan color[4] ) +static void clear_color( GLcontext* ctx, const GLfloat color[4] ) { - Current->clearpixel = RGB(color[0], color[1], color[2]); + GLubyte col[4]; + CLAMPED_FLOAT_TO_UBYTE(col[0], color[0]); + CLAMPED_FLOAT_TO_UBYTE(col[1], color[1]); + CLAMPED_FLOAT_TO_UBYTE(col[2], color[2]); + Current->clearpixel = RGB(col[0], col[1], col[2]); } diff --git a/src/mesa/drivers/windows/wmesa_stereo.c b/src/mesa/drivers/windows/wmesa_stereo.c index fea0dc42292..1781b0e4397 100644 --- a/src/mesa/drivers/windows/wmesa_stereo.c +++ b/src/mesa/drivers/windows/wmesa_stereo.c @@ -153,10 +153,14 @@ static void clear_index(GLcontext* ctx, GLuint index) /*
* Set the color used to clear the color buffer.
*/
-static void clear_color( GLcontext* ctx, const GLchan color[4] )
+static void clear_color( GLcontext* ctx, const GLfloat color[4] )
{
STARTPROFILE
- Current->clearpixel = RGB(color[0], color[1], color[2]);
+ GLubyte col[4];
+ CLAMPED_FLOAT_TO_UBYTE(col[0], color[0]);
+ CLAMPED_FLOAT_TO_UBYTE(col[1], color[1]);
+ CLAMPED_FLOAT_TO_UBYTE(col[2], color[2]);
+ Current->clearpixel = RGB(col[0], col[1], col[2]);
ENDPROFILE(clear_color)
}
|