summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2001-01-23 23:39:36 +0000
committerBrian Paul <[email protected]>2001-01-23 23:39:36 +0000
commitb6bcae5698df88f7730d40004ce7ce0462e97a20 (patch)
tree14c77826b5016293914eb529822e609792150964 /src/mesa/main
parentab0c886a6c0dd38ac6168c2a239720a761e6578f (diff)
Replaced struct gl_visual with struct __GLcontextModesRec from glcore.h.
Replace "RGBAMode" with "rgbMode", etc. Other minor clean-ups.
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/accum.c4
-rw-r--r--src/mesa/main/attrib.c6
-rw-r--r--src/mesa/main/buffers.c46
-rw-r--r--src/mesa/main/context.c101
-rw-r--r--src/mesa/main/dlist.c6
-rw-r--r--src/mesa/main/enable.c14
-rw-r--r--src/mesa/main/feedback.c12
-rw-r--r--src/mesa/main/get.c124
-rw-r--r--src/mesa/main/image.c8
-rw-r--r--src/mesa/main/light.c4
-rw-r--r--src/mesa/main/matrix.c12
-rw-r--r--src/mesa/main/mtypes.h45
-rw-r--r--src/mesa/main/pixel.c22
-rw-r--r--src/mesa/main/polygon.c8
-rw-r--r--src/mesa/main/rastpos.c10
15 files changed, 199 insertions, 223 deletions
diff --git a/src/mesa/main/accum.c b/src/mesa/main/accum.c
index e8f9ca9f92a..1d8d810a395 100644
--- a/src/mesa/main/accum.c
+++ b/src/mesa/main/accum.c
@@ -1,4 +1,4 @@
-/* $Id: accum.c,v 1.33 2000/12/26 05:09:27 keithw Exp $ */
+/* $Id: accum.c,v 1.34 2001/01/23 23:39:36 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -69,7 +69,7 @@ _mesa_Accum( GLenum op, GLfloat value )
GLuint xpos, ypos, width, height;
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
- if (ctx->Visual.AccumRedBits == 0 || ctx->DrawBuffer != ctx->ReadBuffer) {
+ if (ctx->Visual.accumRedBits == 0 || ctx->DrawBuffer != ctx->ReadBuffer) {
gl_error(ctx, GL_INVALID_OPERATION, "glAccum");
return;
}
diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c
index 6158a64869c..e669ff11d59 100644
--- a/src/mesa/main/attrib.c
+++ b/src/mesa/main/attrib.c
@@ -1,10 +1,10 @@
-/* $Id: attrib.c,v 1.39 2000/12/26 05:09:27 keithw Exp $ */
+/* $Id: attrib.c,v 1.40 2001/01/23 23:39:36 brianp Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -588,7 +588,7 @@ _mesa_PopAttrib(void)
ctx->Driver.LogicOpcode) {
ctx->Driver.LogicOpcode( ctx, ctx->Color.LogicOp );
}
- if (ctx->Visual.RGBAflag) {
+ if (ctx->Visual.rgbMode) {
GLchan r = (GLint) (ctx->Color.ClearColor[0] * CHAN_MAXF);
GLchan g = (GLint) (ctx->Color.ClearColor[1] * CHAN_MAXF);
GLchan b = (GLint) (ctx->Color.ClearColor[2] * CHAN_MAXF);
diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c
index c67c8e865ec..410524e3352 100644
--- a/src/mesa/main/buffers.c
+++ b/src/mesa/main/buffers.c
@@ -1,10 +1,10 @@
-/* $Id: buffers.c,v 1.22 2001/01/05 02:26:48 keithw Exp $ */
+/* $Id: buffers.c,v 1.23 2001/01/23 23:39:36 brianp Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -58,7 +58,7 @@ _mesa_ClearIndex( GLfloat c )
FLUSH_VERTICES(ctx, _NEW_COLOR);
ctx->Color.ClearIndex = (GLuint) c;
- if (!ctx->Visual.RGBAflag) {
+ if (!ctx->Visual.rgbMode) {
/* it's OK to call glClearIndex in RGBA mode but it should be a NOP */
(*ctx->Driver.ClearIndex)( ctx, ctx->Color.ClearIndex );
}
@@ -85,7 +85,7 @@ _mesa_ClearColor( GLclampf red, GLclampf green,
FLUSH_VERTICES(ctx, _NEW_COLOR);
COPY_4FV( ctx->Color.ClearColor, tmp );
- if (ctx->Visual.RGBAflag) {
+ if (ctx->Visual.rgbMode) {
GLchan r = (GLint) (ctx->Color.ClearColor[0] * CHAN_MAXF);
GLchan g = (GLint) (ctx->Color.ClearColor[1] * CHAN_MAXF);
GLchan b = (GLint) (ctx->Color.ClearColor[2] * CHAN_MAXF);
@@ -175,63 +175,63 @@ _mesa_DrawBuffer( GLenum mode )
gl_error( ctx, GL_INVALID_OPERATION, "glDrawBuffer" );
return;
case GL_RIGHT:
- if (!ctx->Visual.StereoFlag) {
+ if (!ctx->Visual.stereoMode) {
gl_error( ctx, GL_INVALID_OPERATION, "glDrawBuffer" );
return;}
- if (ctx->Visual.DBflag)
+ if (ctx->Visual.doubleBufferMode)
ctx->Color.DrawDestMask = FRONT_RIGHT_BIT | BACK_RIGHT_BIT;
else
ctx->Color.DrawDestMask = FRONT_RIGHT_BIT;
break;
case GL_FRONT_RIGHT:
- if (!ctx->Visual.StereoFlag) {
+ if (!ctx->Visual.stereoMode) {
gl_error( ctx, GL_INVALID_OPERATION, "glDrawBuffer" );
return;
}
ctx->Color.DrawDestMask = FRONT_RIGHT_BIT;
break;
case GL_BACK_RIGHT:
- if (!ctx->Visual.StereoFlag) {
+ if (!ctx->Visual.stereoMode) {
gl_error( ctx, GL_INVALID_OPERATION, "glDrawBuffer" );
return;
}
- if (!ctx->Visual.DBflag) {
+ if (!ctx->Visual.doubleBufferMode) {
gl_error( ctx, GL_INVALID_OPERATION, "glDrawBuffer" );
return;
}
ctx->Color.DrawDestMask = BACK_RIGHT_BIT;
break;
case GL_BACK_LEFT:
- if (!ctx->Visual.DBflag) {
+ if (!ctx->Visual.doubleBufferMode) {
gl_error( ctx, GL_INVALID_OPERATION, "glDrawBuffer" );
return;
}
ctx->Color.DrawDestMask = BACK_LEFT_BIT;
break;
case GL_FRONT_AND_BACK:
- if (!ctx->Visual.DBflag) {
+ if (!ctx->Visual.doubleBufferMode) {
gl_error( ctx, GL_INVALID_OPERATION, "glDrawBuffer" );
return;
}
- if (ctx->Visual.StereoFlag)
+ if (ctx->Visual.stereoMode)
ctx->Color.DrawDestMask = FRONT_LEFT_BIT | BACK_LEFT_BIT
| FRONT_RIGHT_BIT | BACK_RIGHT_BIT;
else
ctx->Color.DrawDestMask = FRONT_LEFT_BIT | BACK_LEFT_BIT;
break;
case GL_BACK:
- if (!ctx->Visual.DBflag) {
+ if (!ctx->Visual.doubleBufferMode) {
gl_error( ctx, GL_INVALID_OPERATION, "glDrawBuffer" );
return;
}
- if (ctx->Visual.StereoFlag)
+ if (ctx->Visual.stereoMode)
ctx->Color.DrawDestMask = BACK_LEFT_BIT | BACK_RIGHT_BIT;
else
ctx->Color.DrawDestMask = BACK_LEFT_BIT;
break;
case GL_LEFT:
/* never an error */
- if (ctx->Visual.DBflag)
+ if (ctx->Visual.doubleBufferMode)
ctx->Color.DrawDestMask = FRONT_LEFT_BIT | BACK_LEFT_BIT;
else
ctx->Color.DrawDestMask = FRONT_LEFT_BIT;
@@ -242,7 +242,7 @@ _mesa_DrawBuffer( GLenum mode )
break;
case GL_FRONT:
/* never an error */
- if (ctx->Visual.StereoFlag)
+ if (ctx->Visual.stereoMode)
ctx->Color.DrawDestMask = FRONT_LEFT_BIT | FRONT_RIGHT_BIT;
else
ctx->Color.DrawDestMask = FRONT_LEFT_BIT;
@@ -259,13 +259,13 @@ _mesa_DrawBuffer( GLenum mode )
/*
* Make the dest buffer mode more precise if possible
*/
- if (mode == GL_LEFT && !ctx->Visual.DBflag)
+ if (mode == GL_LEFT && !ctx->Visual.doubleBufferMode)
ctx->Color.DriverDrawBuffer = GL_FRONT_LEFT;
- else if (mode == GL_RIGHT && !ctx->Visual.DBflag)
+ else if (mode == GL_RIGHT && !ctx->Visual.doubleBufferMode)
ctx->Color.DriverDrawBuffer = GL_FRONT_RIGHT;
- else if (mode == GL_FRONT && !ctx->Visual.StereoFlag)
+ else if (mode == GL_FRONT && !ctx->Visual.stereoMode)
ctx->Color.DriverDrawBuffer = GL_FRONT_LEFT;
- else if (mode == GL_BACK && !ctx->Visual.StereoFlag)
+ else if (mode == GL_BACK && !ctx->Visual.stereoMode)
ctx->Color.DriverDrawBuffer = GL_BACK_LEFT;
else
ctx->Color.DriverDrawBuffer = mode;
@@ -335,7 +335,7 @@ _mesa_ReadBuffer( GLenum mode )
case GL_BACK:
case GL_BACK_LEFT:
/* Back-Left buffer, requires double buffering */
- if (!ctx->Visual.DBflag) {
+ if (!ctx->Visual.doubleBufferMode) {
gl_error( ctx, GL_INVALID_OPERATION, "glReadBuffer" );
return;
}
@@ -343,14 +343,14 @@ _mesa_ReadBuffer( GLenum mode )
break;
case GL_FRONT_RIGHT:
case GL_RIGHT:
- if (!ctx->Visual.StereoFlag) {
+ if (!ctx->Visual.stereoMode) {
gl_error( ctx, GL_INVALID_OPERATION, "glReadBuffer" );
return;
}
ctx->Pixel.DriverReadBuffer = GL_FRONT_RIGHT;
break;
case GL_BACK_RIGHT:
- if (!ctx->Visual.StereoFlag || !ctx->Visual.DBflag) {
+ if (!ctx->Visual.stereoMode || !ctx->Visual.doubleBufferMode) {
gl_error( ctx, GL_INVALID_OPERATION, "glReadBuffer" );
return;
}
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 4b951c89f71..736d13a2e96 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -1,10 +1,10 @@
-/* $Id: context.c,v 1.116 2001/01/08 04:09:41 keithw Exp $ */
+/* $Id: context.c,v 1.117 2001/01/23 23:39:36 brianp Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -239,6 +239,8 @@ _mesa_initialize_visual( GLvisual *vis,
GLint accumAlphaBits,
GLint numSamples )
{
+ (void) numSamples;
+
assert(vis);
/* This is to catch bad values from device drivers not updated for
@@ -266,43 +268,21 @@ _mesa_initialize_visual( GLvisual *vis,
return GL_FALSE;
}
- vis->RGBAflag = rgbFlag;
- vis->DBflag = dbFlag;
- vis->StereoFlag = stereoFlag;
- vis->RedBits = redBits;
- vis->GreenBits = greenBits;
- vis->BlueBits = blueBits;
- vis->AlphaBits = alphaBits;
-
- vis->IndexBits = indexBits;
- vis->DepthBits = depthBits;
- vis->AccumRedBits = (accumRedBits > 0) ? (8 * sizeof(GLaccum)) : 0;
- vis->AccumGreenBits = (accumGreenBits > 0) ? (8 * sizeof(GLaccum)) : 0;
- vis->AccumBlueBits = (accumBlueBits > 0) ? (8 * sizeof(GLaccum)) : 0;
- vis->AccumAlphaBits = (accumAlphaBits > 0) ? (8 * sizeof(GLaccum)) : 0;
- vis->StencilBits = (stencilBits > 0) ? (8 * sizeof(GLstencil)) : 0;
+ vis->rgbMode = rgbFlag;
+ vis->doubleBufferMode = dbFlag;
+ vis->stereoMode = stereoFlag;
+ vis->redBits = redBits;
+ vis->greenBits = greenBits;
+ vis->blueBits = blueBits;
+ vis->alphaBits = alphaBits;
- if (depthBits == 0) {
- /* Special case. Even if we don't have a depth buffer we need
- * good values for DepthMax for Z vertex transformation purposes
- * and for per-fragment fog computation.
- */
- vis->DepthMax = 1 << 16;
- vis->DepthMaxF = (GLfloat) vis->DepthMax;
- }
- else if (depthBits < 32) {
- vis->DepthMax = (1 << depthBits) - 1;
- vis->DepthMaxF = (GLfloat) vis->DepthMax;
- }
- else {
- /* Special case since shift values greater than or equal to the
- * number of bits in the left hand expression's type are
- * undefined.
- */
- vis->DepthMax = 0xffffffff;
- vis->DepthMaxF = (GLfloat) vis->DepthMax;
- }
- vis->MRD = 2.0; /* XXX temporary value */
+ vis->indexBits = indexBits;
+ vis->depthBits = depthBits;
+ vis->accumRedBits = (accumRedBits > 0) ? (8 * sizeof(GLaccum)) : 0;
+ vis->accumGreenBits = (accumGreenBits > 0) ? (8 * sizeof(GLaccum)) : 0;
+ vis->accumBlueBits = (accumBlueBits > 0) ? (8 * sizeof(GLaccum)) : 0;
+ vis->accumAlphaBits = (accumAlphaBits > 0) ? (8 * sizeof(GLaccum)) : 0;
+ vis->stencilBits = (stencilBits > 0) ? (8 * sizeof(GLstencil)) : 0;
return GL_TRUE;
}
@@ -367,20 +347,20 @@ _mesa_initialize_framebuffer( GLframebuffer *buffer,
/* sanity checks */
if (softwareDepth ) {
- assert(visual->DepthBits > 0);
+ assert(visual->depthBits > 0);
}
if (softwareStencil) {
- assert(visual->StencilBits > 0);
+ assert(visual->stencilBits > 0);
}
if (softwareAccum) {
- assert(visual->RGBAflag);
- assert(visual->AccumRedBits > 0);
- assert(visual->AccumGreenBits > 0);
- assert(visual->AccumBlueBits > 0);
+ assert(visual->rgbMode);
+ assert(visual->accumRedBits > 0);
+ assert(visual->accumGreenBits > 0);
+ assert(visual->accumBlueBits > 0);
}
if (softwareAlpha) {
- assert(visual->RGBAflag);
- assert(visual->AlphaBits > 0);
+ assert(visual->rgbMode);
+ assert(visual->alphaBits > 0);
}
buffer->Visual = visual;
@@ -1159,8 +1139,8 @@ init_attrib_groups( GLcontext *ctx )
#define Sz 10
#define Tz 14
- ctx->Viewport._WindowMap.m[Sz] = 0.5 * ctx->Visual.DepthMaxF;
- ctx->Viewport._WindowMap.m[Tz] = 0.5 * ctx->Visual.DepthMaxF;
+ ctx->Viewport._WindowMap.m[Sz] = 0.5 * ctx->DepthMaxF;
+ ctx->Viewport._WindowMap.m[Tz] = 0.5 * ctx->DepthMaxF;
#undef Sz
#undef Tz
@@ -1408,7 +1388,7 @@ _mesa_initialize_context( GLcontext *ctx,
init_attrib_groups( ctx );
- if (visual->DBflag) {
+ if (visual->doubleBufferMode) {
ctx->Color.DrawBuffer = GL_BACK;
ctx->Color.DriverDrawBuffer = GL_BACK_LEFT;
ctx->Color.DrawDestMask = BACK_LEFT_BIT;
@@ -1461,6 +1441,29 @@ _mesa_initialize_context( GLcontext *ctx,
ctx->ExecPrefersFloat = GL_FALSE;
ctx->SavePrefersFloat = GL_FALSE;
+ /* Z buffer stuff */
+ if (ctx->Visual.depthBits == 0) {
+ /* Special case. Even if we don't have a depth buffer we need
+ * good values for DepthMax for Z vertex transformation purposes
+ * and for per-fragment fog computation.
+ */
+ ctx->DepthMax = 1 << 16;
+ ctx->DepthMaxF = (GLfloat) ctx->DepthMax;
+ }
+ else if (ctx->Visual.depthBits < 32) {
+ ctx->DepthMax = (1 << ctx->Visual.depthBits) - 1;
+ ctx->DepthMaxF = (GLfloat) ctx->DepthMax;
+ }
+ else {
+ /* Special case since shift values greater than or equal to the
+ * number of bits in the left hand expression's type are undefined.
+ */
+ ctx->DepthMax = 0xffffffff;
+ ctx->DepthMaxF = (GLfloat) ctx->DepthMax;
+ }
+ ctx->MRD = 2.0; /* XXX temporary value */
+
+
#if defined(MESA_TRACE)
ctx->TraceCtx = CALLOC( sizeof(trace_context_t) );
#if 0
diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
index 503bb9629c5..2530bcbdc4b 100644
--- a/src/mesa/main/dlist.c
+++ b/src/mesa/main/dlist.c
@@ -1,10 +1,10 @@
-/* $Id: dlist.c,v 1.61 2001/01/13 18:28:19 keithw Exp $ */
+/* $Id: dlist.c,v 1.62 2001/01/23 23:39:36 brianp Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.3
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -2584,7 +2584,7 @@ static void save_PolygonOffset( GLfloat factor, GLfloat units )
static void save_PolygonOffsetEXT( GLfloat factor, GLfloat bias )
{
GET_CURRENT_CONTEXT(ctx);
- save_PolygonOffset(factor, ctx->Visual.DepthMaxF * bias);
+ save_PolygonOffset(factor, ctx->DepthMaxF * bias);
}
diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
index ca1cd5cf75f..dad03c356aa 100644
--- a/src/mesa/main/enable.c
+++ b/src/mesa/main/enable.c
@@ -1,4 +1,4 @@
-/* $Id: enable.c,v 1.39 2001/01/05 05:31:42 keithw Exp $ */
+/* $Id: enable.c,v 1.40 2001/01/23 23:39:36 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -212,7 +212,7 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state )
ctx->Polygon.CullFlag = state;
break;
case GL_DEPTH_TEST:
- if (state && ctx->Visual.DepthBits==0) {
+ if (state && ctx->Visual.depthBits==0) {
_mesa_warning(ctx,"glEnable(GL_DEPTH_TEST) but no depth buffer");
return;
}
@@ -481,7 +481,7 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state )
ctx->Texture.SharedPalette = state;
break;
case GL_STENCIL_TEST:
- if (state && ctx->Visual.StencilBits==0) {
+ if (state && ctx->Visual.stencilBits==0) {
_mesa_warning(ctx, "glEnable(GL_STENCIL_TEST) but no stencil buffer");
return;
}
@@ -497,7 +497,7 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state )
GLuint newenabled = texUnit->Enabled & ~TEXTURE0_1D;
if (state)
newenabled |= TEXTURE0_1D;
- if (!ctx->Visual.RGBAflag || texUnit->Enabled == newenabled)
+ if (!ctx->Visual.rgbMode || texUnit->Enabled == newenabled)
return;
FLUSH_VERTICES(ctx, _NEW_TEXTURE);
texUnit->Enabled = newenabled;
@@ -509,7 +509,7 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state )
GLuint newenabled = texUnit->Enabled & ~TEXTURE0_2D;
if (state)
newenabled |= TEXTURE0_2D;
- if (!ctx->Visual.RGBAflag || texUnit->Enabled == newenabled)
+ if (!ctx->Visual.rgbMode || texUnit->Enabled == newenabled)
return;
FLUSH_VERTICES(ctx, _NEW_TEXTURE);
texUnit->Enabled = newenabled;
@@ -521,7 +521,7 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state )
GLuint newenabled = texUnit->Enabled & ~TEXTURE0_3D;
if (state)
newenabled |= TEXTURE0_3D;
- if (!ctx->Visual.RGBAflag || texUnit->Enabled == newenabled)
+ if (!ctx->Visual.rgbMode || texUnit->Enabled == newenabled)
return;
FLUSH_VERTICES(ctx, _NEW_TEXTURE);
texUnit->Enabled = newenabled;
@@ -708,7 +708,7 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state )
gl_error(ctx, GL_INVALID_ENUM, state ? "glEnable" : "glDisable");
return;
}
- if (!ctx->Visual.RGBAflag || texUnit->Enabled == newenabled)
+ if (!ctx->Visual.rgbMode || texUnit->Enabled == newenabled)
return;
FLUSH_VERTICES(ctx, _NEW_TEXTURE);
texUnit->Enabled = newenabled;
diff --git a/src/mesa/main/feedback.c b/src/mesa/main/feedback.c
index b67e8146c33..1ddd12f3203 100644
--- a/src/mesa/main/feedback.c
+++ b/src/mesa/main/feedback.c
@@ -1,10 +1,10 @@
-/* $Id: feedback.c,v 1.20 2001/01/14 06:14:21 keithw Exp $ */
+/* $Id: feedback.c,v 1.21 2001/01/23 23:39:36 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.3
+ * Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -77,16 +77,16 @@ _mesa_FeedbackBuffer( GLsizei size, GLenum type, GLfloat *buffer )
break;
case GL_3D_COLOR:
ctx->Feedback._Mask = (FB_3D |
- (ctx->Visual.RGBAflag ? FB_COLOR : FB_INDEX));
+ (ctx->Visual.rgbMode ? FB_COLOR : FB_INDEX));
break;
case GL_3D_COLOR_TEXTURE:
ctx->Feedback._Mask = (FB_3D |
- (ctx->Visual.RGBAflag ? FB_COLOR : FB_INDEX) |
+ (ctx->Visual.rgbMode ? FB_COLOR : FB_INDEX) |
FB_TEXTURE);
break;
case GL_4D_COLOR_TEXTURE:
ctx->Feedback._Mask = (FB_3D | FB_4D |
- (ctx->Visual.RGBAflag ? FB_COLOR : FB_INDEX) |
+ (ctx->Visual.rgbMode ? FB_COLOR : FB_INDEX) |
FB_TEXTURE);
break;
default:
diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index d3d562318e8..ecbb16f0433 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -1,10 +1,10 @@
-/* $Id: get.c,v 1.49 2001/01/02 22:02:51 brianp Exp $ */
+/* $Id: get.c,v 1.50 2001/01/23 23:39:36 brianp Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -105,16 +105,16 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
switch (pname) {
case GL_ACCUM_RED_BITS:
- *params = INT_TO_BOOL(ctx->Visual.AccumRedBits);
+ *params = INT_TO_BOOL(ctx->Visual.accumRedBits);
break;
case GL_ACCUM_GREEN_BITS:
- *params = INT_TO_BOOL(ctx->Visual.AccumGreenBits);
+ *params = INT_TO_BOOL(ctx->Visual.accumGreenBits);
break;
case GL_ACCUM_BLUE_BITS:
- *params = INT_TO_BOOL(ctx->Visual.AccumBlueBits);
+ *params = INT_TO_BOOL(ctx->Visual.accumBlueBits);
break;
case GL_ACCUM_ALPHA_BITS:
- *params = INT_TO_BOOL(ctx->Visual.AccumAlphaBits);
+ *params = INT_TO_BOOL(ctx->Visual.accumAlphaBits);
break;
case GL_ACCUM_CLEAR_VALUE:
params[0] = FLOAT_TO_BOOL(ctx->Accum.ClearColor[0]);
@@ -126,7 +126,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
*params = FLOAT_TO_BOOL(ctx->Pixel.AlphaBias);
break;
case GL_ALPHA_BITS:
- *params = INT_TO_BOOL(ctx->Visual.AlphaBits);
+ *params = INT_TO_BOOL(ctx->Visual.alphaBits);
break;
case GL_ALPHA_SCALE:
*params = FLOAT_TO_BOOL(ctx->Pixel.AlphaScale);
@@ -183,7 +183,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
*params = FLOAT_TO_BOOL(ctx->Pixel.BlueBias);
break;
case GL_BLUE_BITS:
- *params = INT_TO_BOOL( ctx->Visual.BlueBits );
+ *params = INT_TO_BOOL( ctx->Visual.blueBits );
break;
case GL_BLUE_SCALE:
*params = FLOAT_TO_BOOL(ctx->Pixel.BlueScale);
@@ -281,7 +281,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
*params = FLOAT_TO_BOOL(ctx->Pixel.DepthBias);
break;
case GL_DEPTH_BITS:
- *params = INT_TO_BOOL(ctx->Visual.DepthBits);
+ *params = INT_TO_BOOL(ctx->Visual.depthBits);
break;
case GL_DEPTH_CLEAR_VALUE:
*params = FLOAT_TO_BOOL(ctx->Depth.Clear);
@@ -306,7 +306,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
*params = ctx->Color.DitherFlag;
break;
case GL_DOUBLEBUFFER:
- *params = ctx->Visual.DBflag;
+ *params = ctx->Visual.doubleBufferMode;
break;
case GL_DRAW_BUFFER:
*params = ENUM_TO_BOOL(ctx->Color.DrawBuffer);
@@ -355,7 +355,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
*params = FLOAT_TO_BOOL(ctx->Pixel.GreenBias);
break;
case GL_GREEN_BITS:
- *params = INT_TO_BOOL( ctx->Visual.GreenBits );
+ *params = INT_TO_BOOL( ctx->Visual.greenBits );
break;
case GL_GREEN_SCALE:
*params = FLOAT_TO_BOOL(ctx->Pixel.GreenScale);
@@ -370,13 +370,13 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
}
break;
case GL_INDEX_BITS:
- *params = INT_TO_BOOL( ctx->Visual.IndexBits );
+ *params = INT_TO_BOOL( ctx->Visual.indexBits );
break;
case GL_INDEX_CLEAR_VALUE:
*params = INT_TO_BOOL(ctx->Color.ClearIndex);
break;
case GL_INDEX_MODE:
- *params = ctx->Visual.RGBAflag ? GL_FALSE : GL_TRUE;
+ *params = ctx->Visual.rgbMode ? GL_FALSE : GL_TRUE;
break;
case GL_INDEX_OFFSET:
*params = INT_TO_BOOL(ctx->Pixel.IndexOffset);
@@ -735,7 +735,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
*params = FLOAT_TO_BOOL(ctx->Pixel.RedBias);
break;
case GL_RED_BITS:
- *params = INT_TO_BOOL( ctx->Visual.RedBits );
+ *params = INT_TO_BOOL( ctx->Visual.redBits );
break;
case GL_RED_SCALE:
*params = FLOAT_TO_BOOL(ctx->Pixel.RedScale);
@@ -747,7 +747,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
*params = ctx->Transform.RescaleNormals;
break;
case GL_RGBA_MODE:
- *params = ctx->Visual.RGBAflag;
+ *params = ctx->Visual.rgbMode;
break;
case GL_SCISSOR_BOX:
params[0] = INT_TO_BOOL(ctx->Scissor.X);
@@ -768,7 +768,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
*params = ctx->Texture.SharedPalette;
break;
case GL_STENCIL_BITS:
- *params = INT_TO_BOOL(ctx->Visual.StencilBits);
+ *params = INT_TO_BOOL(ctx->Visual.stencilBits);
break;
case GL_STENCIL_CLEAR_VALUE:
*params = INT_TO_BOOL(ctx->Stencil.Clear);
@@ -798,7 +798,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params )
*params = INT_TO_BOOL(ctx->Stencil.WriteMask);
break;
case GL_STEREO:
- *params = ctx->Visual.StereoFlag;
+ *params = ctx->Visual.stereoMode;
break;
case GL_SUBPIXEL_BITS:
*params = INT_TO_BOOL(ctx->Const.SubPixelBits);
@@ -1343,16 +1343,16 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params )
switch (pname) {
case GL_ACCUM_RED_BITS:
- *params = (GLdouble) ctx->Visual.AccumRedBits;
+ *params = (GLdouble) ctx->Visual.accumRedBits;
break;
case GL_ACCUM_GREEN_BITS:
- *params = (GLdouble) ctx->Visual.AccumGreenBits;
+ *params = (GLdouble) ctx->Visual.accumGreenBits;
break;
case GL_ACCUM_BLUE_BITS:
- *params = (GLdouble) ctx->Visual.AccumBlueBits;
+ *params = (GLdouble) ctx->Visual.accumBlueBits;
break;
case GL_ACCUM_ALPHA_BITS:
- *params = (GLdouble) ctx->Visual.AccumAlphaBits;
+ *params = (GLdouble) ctx->Visual.accumAlphaBits;
break;
case GL_ACCUM_CLEAR_VALUE:
params[0] = (GLdouble) ctx->Accum.ClearColor[0];
@@ -1364,7 +1364,7 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params )
*params = (GLdouble) ctx->Pixel.AlphaBias;
break;
case GL_ALPHA_BITS:
- *params = (GLdouble) ctx->Visual.AlphaBits;
+ *params = (GLdouble) ctx->Visual.alphaBits;
break;
case GL_ALPHA_SCALE:
*params = (GLdouble) ctx->Pixel.AlphaScale;
@@ -1421,7 +1421,7 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params )
*params = (GLdouble) ctx->Pixel.BlueBias;
break;
case GL_BLUE_BITS:
- *params = (GLdouble) ctx->Visual.BlueBits;
+ *params = (GLdouble) ctx->Visual.blueBits;
break;
case GL_BLUE_SCALE:
*params = (GLdouble) ctx->Pixel.BlueScale;
@@ -1519,7 +1519,7 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params )
*params = (GLdouble) ctx->Pixel.DepthBias;
break;
case GL_DEPTH_BITS:
- *params = (GLdouble) ctx->Visual.DepthBits;
+ *params = (GLdouble) ctx->Visual.depthBits;
break;
case GL_DEPTH_CLEAR_VALUE:
*params = (GLdouble) ctx->Depth.Clear;
@@ -1544,7 +1544,7 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params )
*params = (GLdouble) ctx->Color.DitherFlag;
break;
case GL_DOUBLEBUFFER:
- *params = (GLdouble) ctx->Visual.DBflag;
+ *params = (GLdouble) ctx->Visual.doubleBufferMode;
break;
case GL_DRAW_BUFFER:
*params = ENUM_TO_DOUBLE(ctx->Color.DrawBuffer);
@@ -1593,7 +1593,7 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params )
*params = (GLdouble) ctx->Pixel.GreenBias;
break;
case GL_GREEN_BITS:
- *params = (GLdouble) ctx->Visual.GreenBits;
+ *params = (GLdouble) ctx->Visual.greenBits;
break;
case GL_GREEN_SCALE:
*params = (GLdouble) ctx->Pixel.GreenScale;
@@ -1608,13 +1608,13 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params )
}
break;
case GL_INDEX_BITS:
- *params = (GLdouble) ctx->Visual.IndexBits;
+ *params = (GLdouble) ctx->Visual.indexBits;
break;
case GL_INDEX_CLEAR_VALUE:
*params = (GLdouble) ctx->Color.ClearIndex;
break;
case GL_INDEX_MODE:
- *params = ctx->Visual.RGBAflag ? 0.0 : 1.0;
+ *params = ctx->Visual.rgbMode ? 0.0 : 1.0;
break;
case GL_INDEX_OFFSET:
*params = (GLdouble) ctx->Pixel.IndexOffset;
@@ -1973,7 +1973,7 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params )
*params = (GLdouble) ctx->Pixel.RedBias;
break;
case GL_RED_BITS:
- *params = (GLdouble) ctx->Visual.RedBits;
+ *params = (GLdouble) ctx->Visual.redBits;
break;
case GL_RED_SCALE:
*params = (GLdouble) ctx->Pixel.RedScale;
@@ -1985,7 +1985,7 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params )
*params = (GLdouble) ctx->Transform.RescaleNormals;
break;
case GL_RGBA_MODE:
- *params = (GLdouble) ctx->Visual.RGBAflag;
+ *params = (GLdouble) ctx->Visual.rgbMode;
break;
case GL_SCISSOR_BOX:
params[0] = (GLdouble) ctx->Scissor.X;
@@ -2006,7 +2006,7 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params )
*params = (GLdouble) ctx->Texture.SharedPalette;
break;
case GL_STENCIL_BITS:
- *params = (GLdouble) ctx->Visual.StencilBits;
+ *params = (GLdouble) ctx->Visual.stencilBits;
break;
case GL_STENCIL_CLEAR_VALUE:
*params = (GLdouble) ctx->Stencil.Clear;
@@ -2036,7 +2036,7 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params )
*params = (GLdouble) ctx->Stencil.WriteMask;
break;
case GL_STEREO:
- *params = (GLdouble) ctx->Visual.StereoFlag;
+ *params = (GLdouble) ctx->Visual.stereoMode;
break;
case GL_SUBPIXEL_BITS:
*params = (GLdouble) ctx->Const.SubPixelBits;
@@ -2581,16 +2581,16 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
switch (pname) {
case GL_ACCUM_RED_BITS:
- *params = (GLfloat) ctx->Visual.AccumRedBits;
+ *params = (GLfloat) ctx->Visual.accumRedBits;
break;
case GL_ACCUM_GREEN_BITS:
- *params = (GLfloat) ctx->Visual.AccumGreenBits;
+ *params = (GLfloat) ctx->Visual.accumGreenBits;
break;
case GL_ACCUM_BLUE_BITS:
- *params = (GLfloat) ctx->Visual.AccumBlueBits;
+ *params = (GLfloat) ctx->Visual.accumBlueBits;
break;
case GL_ACCUM_ALPHA_BITS:
- *params = (GLfloat) ctx->Visual.AccumAlphaBits;
+ *params = (GLfloat) ctx->Visual.accumAlphaBits;
break;
case GL_ACCUM_CLEAR_VALUE:
params[0] = ctx->Accum.ClearColor[0];
@@ -2602,7 +2602,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
*params = ctx->Pixel.AlphaBias;
break;
case GL_ALPHA_BITS:
- *params = (GLfloat) ctx->Visual.AlphaBits;
+ *params = (GLfloat) ctx->Visual.alphaBits;
break;
case GL_ALPHA_SCALE:
*params = ctx->Pixel.AlphaScale;
@@ -2659,7 +2659,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
*params = ctx->Pixel.BlueBias;
break;
case GL_BLUE_BITS:
- *params = (GLfloat) ctx->Visual.BlueBits;
+ *params = (GLfloat) ctx->Visual.blueBits;
break;
case GL_BLUE_SCALE:
*params = ctx->Pixel.BlueScale;
@@ -2757,7 +2757,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
*params = (GLfloat) ctx->Pixel.DepthBias;
break;
case GL_DEPTH_BITS:
- *params = (GLfloat) ctx->Visual.DepthBits;
+ *params = (GLfloat) ctx->Visual.depthBits;
break;
case GL_DEPTH_CLEAR_VALUE:
*params = (GLfloat) ctx->Depth.Clear;
@@ -2782,7 +2782,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
*params = (GLfloat) ctx->Color.DitherFlag;
break;
case GL_DOUBLEBUFFER:
- *params = (GLfloat) ctx->Visual.DBflag;
+ *params = (GLfloat) ctx->Visual.doubleBufferMode;
break;
case GL_DRAW_BUFFER:
*params = ENUM_TO_FLOAT(ctx->Color.DrawBuffer);
@@ -2831,7 +2831,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
*params = (GLfloat) ctx->Pixel.GreenBias;
break;
case GL_GREEN_BITS:
- *params = (GLfloat) ctx->Visual.GreenBits;
+ *params = (GLfloat) ctx->Visual.greenBits;
break;
case GL_GREEN_SCALE:
*params = (GLfloat) ctx->Pixel.GreenScale;
@@ -2846,13 +2846,13 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
}
break;
case GL_INDEX_BITS:
- *params = (GLfloat) ctx->Visual.IndexBits;
+ *params = (GLfloat) ctx->Visual.indexBits;
break;
case GL_INDEX_CLEAR_VALUE:
*params = (GLfloat) ctx->Color.ClearIndex;
break;
case GL_INDEX_MODE:
- *params = ctx->Visual.RGBAflag ? 0.0F : 1.0F;
+ *params = ctx->Visual.rgbMode ? 0.0F : 1.0F;
break;
case GL_INDEX_OFFSET:
*params = (GLfloat) ctx->Pixel.IndexOffset;
@@ -3213,7 +3213,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
*params = ctx->Pixel.RedBias;
break;
case GL_RED_BITS:
- *params = (GLfloat) ctx->Visual.RedBits;
+ *params = (GLfloat) ctx->Visual.redBits;
break;
case GL_RED_SCALE:
*params = ctx->Pixel.RedScale;
@@ -3225,7 +3225,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
*params = (GLfloat) ctx->Transform.RescaleNormals;
break;
case GL_RGBA_MODE:
- *params = (GLfloat) ctx->Visual.RGBAflag;
+ *params = (GLfloat) ctx->Visual.rgbMode;
break;
case GL_SCISSOR_BOX:
params[0] = (GLfloat) ctx->Scissor.X;
@@ -3246,7 +3246,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
*params = (GLfloat) ctx->Texture.SharedPalette;
break;
case GL_STENCIL_BITS:
- *params = (GLfloat) ctx->Visual.StencilBits;
+ *params = (GLfloat) ctx->Visual.stencilBits;
break;
case GL_STENCIL_CLEAR_VALUE:
*params = (GLfloat) ctx->Stencil.Clear;
@@ -3276,7 +3276,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params )
*params = (GLfloat) ctx->Stencil.WriteMask;
break;
case GL_STEREO:
- *params = (GLfloat) ctx->Visual.StereoFlag;
+ *params = (GLfloat) ctx->Visual.stereoMode;
break;
case GL_SUBPIXEL_BITS:
*params = (GLfloat) ctx->Const.SubPixelBits;
@@ -3794,16 +3794,16 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
switch (pname) {
case GL_ACCUM_RED_BITS:
- *params = (GLint) ctx->Visual.AccumRedBits;
+ *params = (GLint) ctx->Visual.accumRedBits;
break;
case GL_ACCUM_GREEN_BITS:
- *params = (GLint) ctx->Visual.AccumGreenBits;
+ *params = (GLint) ctx->Visual.accumGreenBits;
break;
case GL_ACCUM_BLUE_BITS:
- *params = (GLint) ctx->Visual.AccumBlueBits;
+ *params = (GLint) ctx->Visual.accumBlueBits;
break;
case GL_ACCUM_ALPHA_BITS:
- *params = (GLint) ctx->Visual.AccumAlphaBits;
+ *params = (GLint) ctx->Visual.accumAlphaBits;
break;
case GL_ACCUM_CLEAR_VALUE:
params[0] = FLOAT_TO_INT( ctx->Accum.ClearColor[0] );
@@ -3815,7 +3815,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
*params = (GLint) ctx->Pixel.AlphaBias;
break;
case GL_ALPHA_BITS:
- *params = ctx->Visual.AlphaBits;
+ *params = ctx->Visual.alphaBits;
break;
case GL_ALPHA_SCALE:
*params = (GLint) ctx->Pixel.AlphaScale;
@@ -3872,7 +3872,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
*params = (GLint) ctx->Pixel.BlueBias;
break;
case GL_BLUE_BITS:
- *params = (GLint) ctx->Visual.BlueBits;
+ *params = (GLint) ctx->Visual.blueBits;
break;
case GL_BLUE_SCALE:
*params = (GLint) ctx->Pixel.BlueScale;
@@ -3971,7 +3971,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
*params = (GLint) ctx->Pixel.DepthBias;
break;
case GL_DEPTH_BITS:
- *params = ctx->Visual.DepthBits;
+ *params = ctx->Visual.depthBits;
break;
case GL_DEPTH_CLEAR_VALUE:
*params = (GLint) ctx->Depth.Clear;
@@ -3996,7 +3996,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
*params = (GLint) ctx->Color.DitherFlag;
break;
case GL_DOUBLEBUFFER:
- *params = (GLint) ctx->Visual.DBflag;
+ *params = (GLint) ctx->Visual.doubleBufferMode;
break;
case GL_DRAW_BUFFER:
*params = (GLint) ctx->Color.DrawBuffer;
@@ -4045,7 +4045,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
*params = (GLint) ctx->Pixel.GreenBias;
break;
case GL_GREEN_BITS:
- *params = (GLint) ctx->Visual.GreenBits;
+ *params = (GLint) ctx->Visual.greenBits;
break;
case GL_GREEN_SCALE:
*params = (GLint) ctx->Pixel.GreenScale;
@@ -4060,13 +4060,13 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
}
break;
case GL_INDEX_BITS:
- *params = (GLint) ctx->Visual.IndexBits;
+ *params = (GLint) ctx->Visual.indexBits;
break;
case GL_INDEX_CLEAR_VALUE:
*params = (GLint) ctx->Color.ClearIndex;
break;
case GL_INDEX_MODE:
- *params = ctx->Visual.RGBAflag ? 0 : 1;
+ *params = ctx->Visual.rgbMode ? 0 : 1;
break;
case GL_INDEX_OFFSET:
*params = ctx->Pixel.IndexOffset;
@@ -4425,7 +4425,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
*params = (GLint) ctx->Pixel.RedBias;
break;
case GL_RED_BITS:
- *params = (GLint) ctx->Visual.RedBits;
+ *params = (GLint) ctx->Visual.redBits;
break;
case GL_RED_SCALE:
*params = (GLint) ctx->Pixel.RedScale;
@@ -4437,7 +4437,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
*params = (GLint) ctx->Transform.RescaleNormals;
break;
case GL_RGBA_MODE:
- *params = (GLint) ctx->Visual.RGBAflag;
+ *params = (GLint) ctx->Visual.rgbMode;
break;
case GL_SCISSOR_BOX:
params[0] = (GLint) ctx->Scissor.X;
@@ -4458,7 +4458,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
*params = (GLint) ctx->Texture.SharedPalette;
break;
case GL_STENCIL_BITS:
- *params = ctx->Visual.StencilBits;
+ *params = ctx->Visual.stencilBits;
break;
case GL_STENCIL_CLEAR_VALUE:
*params = (GLint) ctx->Stencil.Clear;
@@ -4488,7 +4488,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params )
*params = (GLint) ctx->Stencil.WriteMask;
break;
case GL_STEREO:
- *params = (GLint) ctx->Visual.StereoFlag;
+ *params = (GLint) ctx->Visual.stereoMode;
break;
case GL_SUBPIXEL_BITS:
*params = ctx->Const.SubPixelBits;
diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c
index de56f0be9d0..dfb43c153dc 100644
--- a/src/mesa/main/image.c
+++ b/src/mesa/main/image.c
@@ -1,4 +1,4 @@
-/* $Id: image.c,v 1.52 2001/01/03 15:59:30 brianp Exp $ */
+/* $Id: image.c,v 1.53 2001/01/23 23:39:36 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -2506,7 +2506,7 @@ _mesa_unpack_chan_color_span( GLcontext *ctx,
srcType == GL_UNSIGNED_INT_2_10_10_10_REV);
/* this is intended for RGBA mode only */
- assert(ctx->Visual.RGBAflag);
+ assert(ctx->Visual.rgbMode);
/* Try simple cases first */
if (transferOps == 0 && srcType == CHAN_TYPE) {
@@ -2830,7 +2830,7 @@ _mesa_unpack_float_color_span( GLcontext *ctx,
srcType == GL_UNSIGNED_INT_2_10_10_10_REV);
/* this is intended for RGBA mode only */
- assert(ctx->Visual.RGBAflag);
+ assert(ctx->Visual.rgbMode);
/* general solution, no special cases, yet */
{
@@ -3342,7 +3342,7 @@ _mesa_unpack_depth_span( const GLcontext *ctx, GLuint n, GLdepth *dest,
/* clamp depth values to [0,1] and convert from floats to integers */
{
- const GLfloat zs = ctx->Visual.DepthMaxF;
+ const GLfloat zs = ctx->DepthMaxF;
GLuint i;
for (i = 0; i < n; i++) {
dest[i] = (GLdepth) (CLAMP(depth[i], 0.0F, 1.0F) * zs);
diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c
index bee9f0d807b..fd58399962f 100644
--- a/src/mesa/main/light.c
+++ b/src/mesa/main/light.c
@@ -1,4 +1,4 @@
-/* $Id: light.c,v 1.34 2001/01/13 05:48:25 keithw Exp $ */
+/* $Id: light.c,v 1.35 2001/01/23 23:39:36 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -1163,7 +1163,7 @@ gl_update_lighting( GLcontext *ctx )
* FLUSH_UPDATE_CURRENT, as when any outstanding material changes
* are flushed, they will update the derived state at that time.
*/
- if (ctx->Visual.RGBAflag) {
+ if (ctx->Visual.rgbMode) {
GLuint sides = ctx->Light.Model.TwoSide ? 2 : 1;
GLuint side;
for (side=0; side < sides; side++) {
diff --git a/src/mesa/main/matrix.c b/src/mesa/main/matrix.c
index 2cd471f4e25..f7aea3f4c21 100644
--- a/src/mesa/main/matrix.c
+++ b/src/mesa/main/matrix.c
@@ -1,10 +1,10 @@
-/* $Id: matrix.c,v 1.29 2000/12/26 05:09:29 keithw Exp $ */
+/* $Id: matrix.c,v 1.30 2001/01/23 23:39:36 brianp Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -478,8 +478,8 @@ gl_Viewport( GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height )
ctx->Viewport._WindowMap.m[MAT_TX] = ctx->Viewport._WindowMap.m[MAT_SX] + x;
ctx->Viewport._WindowMap.m[MAT_SY] = (GLfloat) height / 2.0F;
ctx->Viewport._WindowMap.m[MAT_TY] = ctx->Viewport._WindowMap.m[MAT_SY] + y;
- ctx->Viewport._WindowMap.m[MAT_SZ] = 0.5 * ctx->Visual.DepthMaxF;
- ctx->Viewport._WindowMap.m[MAT_TZ] = 0.5 * ctx->Visual.DepthMaxF;
+ ctx->Viewport._WindowMap.m[MAT_SZ] = 0.5 * ctx->DepthMaxF;
+ ctx->Viewport._WindowMap.m[MAT_TZ] = 0.5 * ctx->DepthMaxF;
ctx->Viewport._WindowMap.flags = MAT_FLAG_GENERAL_SCALE|MAT_FLAG_TRANSLATION;
ctx->Viewport._WindowMap.type = MATRIX_3D_NO_ROT;
ctx->NewState |= _NEW_VIEWPORT;
@@ -522,8 +522,8 @@ _mesa_DepthRange( GLclampd nearval, GLclampd farval )
ctx->Viewport.Near = n;
ctx->Viewport.Far = f;
- ctx->Viewport._WindowMap.m[MAT_SZ] = ctx->Visual.DepthMaxF * ((f - n) / 2.0);
- ctx->Viewport._WindowMap.m[MAT_TZ] = ctx->Visual.DepthMaxF * ((f - n) / 2.0 + n);
+ ctx->Viewport._WindowMap.m[MAT_SZ] = ctx->DepthMaxF * ((f - n) / 2.0);
+ ctx->Viewport._WindowMap.m[MAT_TZ] = ctx->DepthMaxF * ((f - n) / 2.0 + n);
ctx->NewState |= _NEW_VIEWPORT;
if (ctx->Driver.DepthRange) {
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index f3a3a56b0a3..66d085ba816 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -1,10 +1,10 @@
-/* $Id: mtypes.h,v 1.13 2001/01/08 21:55:59 keithw Exp $ */
+/* $Id: mtypes.h,v 1.14 2001/01/23 23:39:36 brianp Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -117,9 +117,9 @@ typedef int GLfixed;
*/
struct _mesa_HashTable;
struct gl_texture_object;
-typedef struct gl_visual GLvisual;
-typedef struct gl_frame_buffer GLframebuffer;
typedef struct __GLcontextRec GLcontext;
+typedef struct __GLcontextModesRec GLvisual;
+typedef struct gl_frame_buffer GLframebuffer;
@@ -1099,38 +1099,6 @@ struct gl_shared_state {
/*
- * Describes the color, depth, stencil and accum buffer parameters.
- * In C++ terms, think of this as a base class from which device drivers
- * will make derived classes.
- */
-struct gl_visual {
- GLboolean RGBAflag; /* Is frame buffer in RGBA mode, not CI? */
- GLboolean DBflag; /* Is color buffer double buffered? */
- GLboolean StereoFlag; /* stereo buffer? */
-
- GLint RedBits; /* Bits per color component */
- GLint GreenBits;
- GLint BlueBits;
- GLint AlphaBits;
-
- GLint IndexBits; /* Bits/pixel if in color index mode */
-
- GLint AccumRedBits; /* Number of bits in red accum channel */
- GLint AccumGreenBits; /* Number of bits in green accum channel */
- GLint AccumBlueBits; /* Number of bits in blue accum channel */
- GLint AccumAlphaBits; /* Number of bits in alpha accum channel */
- GLint DepthBits; /* Number of bits in depth buffer, or 0 */
- GLint StencilBits; /* Number of bits in stencil buffer, or 0 */
- GLint NumSamples; /* Samples/pixel for multisampling */
-
- GLuint DepthMax; /* Max depth buffer value */
- GLfloat DepthMaxF; /* Float max depth buffer value */
- GLfloat MRD; /* minimum resolvable difference in Z values */
-};
-
-
-
-/*
* A "frame buffer" is a color buffer and its optional ancillary buffers:
* depth, accum, stencil, and software-simulated alpha buffers.
* In C++ terms, think of this as a base class from which device drivers
@@ -1566,6 +1534,11 @@ struct __GLcontextRec {
GLboolean OcclusionResult; /* GL_HP_occlusion_test */
GLboolean OcclusionResultSaved; /* GL_HP_occlusion_test */
+ /* Z buffer stuff */
+ GLuint DepthMax; /* Max depth buffer value */
+ GLfloat DepthMaxF; /* Float max depth buffer value */
+ GLfloat MRD; /* minimum resolvable difference in Z values */
+
/* Should 3Dfx Glide driver catch signals? */
GLboolean CatchSignals;
diff --git a/src/mesa/main/pixel.c b/src/mesa/main/pixel.c
index 270cbc7e8cb..470a2f8e157 100644
--- a/src/mesa/main/pixel.c
+++ b/src/mesa/main/pixel.c
@@ -1,10 +1,10 @@
-/* $Id: pixel.c,v 1.23 2001/01/03 15:59:30 brianp Exp $ */
+/* $Id: pixel.c,v 1.24 2001/01/23 23:39:36 brianp Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -1254,19 +1254,19 @@ void
_mesa_chan_to_float_span(const GLcontext *ctx, GLuint n,
CONST GLchan rgba[][4], GLfloat rgbaf[][4])
{
- const GLuint rShift = CHAN_BITS - ctx->Visual.RedBits;
- const GLuint gShift = CHAN_BITS - ctx->Visual.GreenBits;
- const GLuint bShift = CHAN_BITS - ctx->Visual.BlueBits;
+ const GLuint rShift = CHAN_BITS - ctx->Visual.redBits;
+ const GLuint gShift = CHAN_BITS - ctx->Visual.greenBits;
+ const GLuint bShift = CHAN_BITS - ctx->Visual.blueBits;
GLuint aShift;
- const GLfloat rScale = 1.0 / (GLfloat) ((1 << ctx->Visual.RedBits ) - 1);
- const GLfloat gScale = 1.0 / (GLfloat) ((1 << ctx->Visual.GreenBits) - 1);
- const GLfloat bScale = 1.0 / (GLfloat) ((1 << ctx->Visual.BlueBits ) - 1);
+ const GLfloat rScale = 1.0 / (GLfloat) ((1 << ctx->Visual.redBits ) - 1);
+ const GLfloat gScale = 1.0 / (GLfloat) ((1 << ctx->Visual.greenBits) - 1);
+ const GLfloat bScale = 1.0 / (GLfloat) ((1 << ctx->Visual.blueBits ) - 1);
GLfloat aScale;
GLuint i;
- if (ctx->Visual.AlphaBits > 0) {
- aShift = CHAN_BITS - ctx->Visual.AlphaBits;
- aScale = 1.0 / (GLfloat) ((1 << ctx->Visual.AlphaBits) - 1);
+ if (ctx->Visual.alphaBits > 0) {
+ aShift = CHAN_BITS - ctx->Visual.alphaBits;
+ aScale = 1.0 / (GLfloat) ((1 << ctx->Visual.alphaBits) - 1);
}
else {
aShift = 0;
diff --git a/src/mesa/main/polygon.c b/src/mesa/main/polygon.c
index 68bcbbe3b80..a0d103f9040 100644
--- a/src/mesa/main/polygon.c
+++ b/src/mesa/main/polygon.c
@@ -1,10 +1,10 @@
-/* $Id: polygon.c,v 1.17 2000/12/26 05:09:29 keithw Exp $ */
+/* $Id: polygon.c,v 1.18 2001/01/23 23:39:36 brianp Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -195,7 +195,7 @@ _mesa_PolygonOffset( GLfloat factor, GLfloat units )
FLUSH_VERTICES(ctx, _NEW_POLYGON);
ctx->Polygon.OffsetFactor = factor;
ctx->Polygon.OffsetUnits = units;
- ctx->Polygon.OffsetMRD = units * ctx->Visual.MRD;
+ ctx->Polygon.OffsetMRD = units * ctx->MRD;
}
@@ -204,5 +204,5 @@ void
_mesa_PolygonOffsetEXT( GLfloat factor, GLfloat bias )
{
GET_CURRENT_CONTEXT(ctx);
- _mesa_PolygonOffset(factor, bias * ctx->Visual.DepthMaxF );
+ _mesa_PolygonOffset(factor, bias * ctx->DepthMaxF );
}
diff --git a/src/mesa/main/rastpos.c b/src/mesa/main/rastpos.c
index badd3e7b371..c2f2226c4d9 100644
--- a/src/mesa/main/rastpos.c
+++ b/src/mesa/main/rastpos.c
@@ -1,10 +1,10 @@
-/* $Id: rastpos.c,v 1.19 2001/01/03 15:56:41 brianp Exp $ */
+/* $Id: rastpos.c,v 1.20 2001/01/23 23:39:36 brianp Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -215,7 +215,7 @@ shade_rastpos(GLcontext *ctx,
ACC_SCALE_SCALAR_3V( color, attenuation, contrib );
}
- if (ctx->Visual.RGBAflag) {
+ if (ctx->Visual.rgbMode) {
Rcolor[0] = CLAMP(color[0], 0.0F, 1.0F);
Rcolor[1] = CLAMP(color[1], 0.0F, 1.0F);
Rcolor[2] = CLAMP(color[2], 0.0F, 1.0F);
@@ -273,7 +273,7 @@ raster_pos4f(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
}
else {
/* use current color or index */
- if (ctx->Visual.RGBAflag) {
+ if (ctx->Visual.rgbMode) {
ctx->Current.RasterColor[0] = CHAN_TO_FLOAT(ctx->Current.Color[0]);
ctx->Current.RasterColor[1] = CHAN_TO_FLOAT(ctx->Current.Color[1]);
ctx->Current.RasterColor[2] = CHAN_TO_FLOAT(ctx->Current.Color[2]);
@@ -316,7 +316,7 @@ raster_pos4f(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
ctx->Current.RasterPos[1] = (ndc[1] * ctx->Viewport._WindowMap.m[MAT_SY] +
ctx->Viewport._WindowMap.m[MAT_TY]);
ctx->Current.RasterPos[2] = (ndc[2] * ctx->Viewport._WindowMap.m[MAT_SZ] +
- ctx->Viewport._WindowMap.m[MAT_TZ]) / ctx->Visual.DepthMaxF;
+ ctx->Viewport._WindowMap.m[MAT_TZ]) / ctx->DepthMaxF;
ctx->Current.RasterPos[3] = clip[3];
ctx->Current.RasterPosValid = GL_TRUE;