aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/windows/wmesa.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2000-11-14 17:40:13 +0000
committerBrian Paul <[email protected]>2000-11-14 17:40:13 +0000
commitc19d783e0715ac01ad4d3fd0705500d2bf6f7039 (patch)
tree68e28470e87358b225e07477a4900d79f8e47b0b /src/mesa/drivers/windows/wmesa.c
parent1e1aac034c986a08248861363c0baa27dc2ae2d5 (diff)
Removed Driver.Color() and Driver.Index() functions.
Pass color or color index directly to WriteMono*() span functions. Updated current s/w drivers accordingly. Clean-up of X gc handling in XMesa driver.
Diffstat (limited to 'src/mesa/drivers/windows/wmesa.c')
-rw-r--r--src/mesa/drivers/windows/wmesa.c47
1 files changed, 14 insertions, 33 deletions
diff --git a/src/mesa/drivers/windows/wmesa.c b/src/mesa/drivers/windows/wmesa.c
index aa0f58c5fcf..55c5c402afc 100644
--- a/src/mesa/drivers/windows/wmesa.c
+++ b/src/mesa/drivers/windows/wmesa.c
@@ -1,4 +1,4 @@
-/* $Id: wmesa.c,v 1.10 2000/11/05 18:41:00 keithw Exp $ */
+/* $Id: wmesa.c,v 1.11 2000/11/14 17:40:15 brianp Exp $ */
/*
* Windows (Win32) device driver for Mesa 3.4
@@ -488,25 +488,6 @@ static GLbitfield clear(GLcontext* ctx, GLbitfield mask,
-/* Set the current color index. */
-static void set_index(GLcontext* ctx, GLuint index)
-{
- STARTPROFILE
- Current->pixel=index;
- ENDPROFILE(set_index)
-}
-
-
-
-/* Set the current RGBA color. */
-static void set_color( GLcontext* ctx, GLubyte r, GLubyte g, GLubyte b, GLubyte a )
-{
- STARTPROFILE
- Current->pixel = RGB( r, g, b );
- ENDPROFILE(set_color)
-}
-
-
static void enable( GLcontext* ctx, GLenum pname, GLboolean enable )
{
if (!Current)
@@ -766,7 +747,7 @@ static void write_ci8_span( const GLcontext* ctx,
*/
static void write_mono_ci_span(const GLcontext* ctx,
GLuint n,GLint x,GLint y,
- const GLubyte mask[])
+ GLuint colorIndex, const GLubyte mask[])
{
STARTPROFILE
GLuint i;
@@ -774,7 +755,7 @@ static void write_mono_ci_span(const GLcontext* ctx,
assert(Current->rgb_flag==GL_FALSE);
for (i=0; i<n; i++)
if (mask[i])
- Mem[i]=Current->pixel;
+ Mem[i]=colorIndex;
ENDPROFILE(write_mono_ci_span)
}
@@ -874,8 +855,9 @@ static void write_rgb_span( const GLcontext* ctx,
*/
static void write_mono_rgba_span( const GLcontext* ctx,
GLuint n, GLint x, GLint y,
- const GLubyte mask[])
+ const GLchan color[4], const GLubyte mask[])
{
+ ULONG pixel = RGB( color[RCOMP], color[GCOMP], color[BCOMP] );
STARTPROFILE
GLuint i;
HDC DC=DD_GETDC;
@@ -886,12 +868,12 @@ static void write_mono_rgba_span( const GLcontext* ctx,
for (i=0; i<n; i++)
if (mask[i])
// Trying
- wmSetPixel(pwc,y,x+i,GetRValue(Current->pixel), GetGValue(Current->pixel), GetBValue(Current->pixel));
+ wmSetPixel(pwc,y,x+i,color[RCOMP], color[GCOMP], color[BCOMP]);
}
else {
for (i=0; i<n; i++)
if (mask[i])
- SetPixel(DC, y, x+i, Current->pixel);
+ SetPixel(DC, y, x+i, pixel);
}
DD_RELEASEDC;
ENDPROFILE(write_mono_rgba_span)
@@ -930,7 +912,7 @@ static void write_ci32_pixels( const GLcontext* ctx,
static void write_mono_ci_pixels( const GLcontext* ctx,
GLuint n,
const GLint x[], const GLint y[],
- const GLubyte mask[] )
+ GLuint colorIndex, const GLubyte mask[] )
{
STARTPROFILE
GLuint i;
@@ -938,7 +920,7 @@ static void write_mono_ci_pixels( const GLcontext* ctx,
for (i=0; i<n; i++) {
if (mask[i]) {
BYTE *Mem=Current->ScreenMem+FLIP(y[i])*Current->ScanWidth+x[i];
- *Mem = Current->pixel;
+ *Mem = colorIndex;
}
}
ENDPROFILE(write_mono_ci_pixels)
@@ -958,7 +940,8 @@ static void write_rgba_pixels( const GLcontext* ctx,
assert(Current->rgb_flag==GL_TRUE);
for (i=0; i<n; i++)
if (mask[i])
- wmSetPixel(pwc, FLIP(y[i]),x[i],rgba[i][RCOMP],rgba[i][GCOMP],rgba[i][BCOMP]);
+ wmSetPixel(pwc, FLIP(y[i]), x[i],
+ rgba[i][RCOMP], rgba[i][GCOMP], rgba[i][BCOMP]);
DD_RELEASEDC;
ENDPROFILE(write_rgba_pixels)
}
@@ -972,6 +955,7 @@ static void write_rgba_pixels( const GLcontext* ctx,
static void write_mono_rgba_pixels( const GLcontext* ctx,
GLuint n,
const GLint x[], const GLint y[],
+ const GLchan color[4],
const GLubyte mask[] )
{
STARTPROFILE
@@ -981,8 +965,8 @@ static void write_mono_rgba_pixels( const GLcontext* ctx,
assert(Current->rgb_flag==GL_TRUE);
for (i=0; i<n; i++)
if (mask[i])
- wmSetPixel(pwc, FLIP(y[i]),x[i],GetRValue(Current->pixel),
- GetGValue(Current->pixel), GetBValue(Current->pixel));
+ wmSetPixel(pwc, FLIP(y[i]),x[i],color[RCOMP],
+ color[GCOMP], color[BCOMP]);
DD_RELEASEDC;
ENDPROFILE(write_mono_rgba_pixels)
}
@@ -1109,9 +1093,6 @@ void setup_DD_pointers( GLcontext* ctx )
ctx->Driver.ClearColor = clear_color;
ctx->Driver.Clear = clear;
- ctx->Driver.Index = set_index;
- ctx->Driver.Color = set_color;
-
ctx->Driver.Enable = enable;
ctx->Driver.SetDrawBuffer = set_draw_buffer;