Replace "RGBAMode" with "rgbMode", etc.
Other minor clean-ups.
fxMesa->glBuffer=_mesa_create_framebuffer(fxMesa->glVis,
GL_FALSE, /* no software depth */
- fxMesa->glVis->StencilBits > 0,
- fxMesa->glVis->AccumRedBits > 0,
- fxMesa->glVis->AlphaBits > 0 );
+ fxMesa->glVis->stencilBits > 0,
+ fxMesa->glVis->accumRedBits > 0,
+ fxMesa->glVis->alphaBits > 0 );
if (!fxMesa->glBuffer) {
errorstr = "_mesa_create_framebuffer";
goto errorhandler;
-/* $Id: osmesa.c,v 1.39 2001/01/16 21:16:56 brianp Exp $ */
+/* $Id: osmesa.c,v 1.40 2001/01/23 23:39:36 brianp Exp $ */
/*
* Mesa 3-D graphics library
_mesa_enable_sw_extensions(&(osmesa->gl_ctx));
osmesa->gl_buffer = _mesa_create_framebuffer( osmesa->gl_visual,
- osmesa->gl_visual->DepthBits > 0,
- osmesa->gl_visual->StencilBits > 0,
- osmesa->gl_visual->AccumRedBits > 0,
- osmesa->gl_visual->AlphaBits > 0 );
+ osmesa->gl_visual->depthBits > 0,
+ osmesa->gl_visual->stencilBits > 0,
+ osmesa->gl_visual->accumRedBits > 0,
+ osmesa->gl_visual->alphaBits > 0 );
if (!osmesa->gl_buffer) {
_mesa_destroy_visual( osmesa->gl_visual );
if (swrast->_RasterMask==DEPTH_BIT
&& ctx->Depth.Func==GL_LESS
&& ctx->Depth.Mask==GL_TRUE
- && ctx->Visual.DepthBits == DEFAULT_SOFTWARE_DEPTH_BITS) {
+ && ctx->Visual.depthBits == DEFAULT_SOFTWARE_DEPTH_BITS) {
switch(osmesa->format) {
case OSMESA_RGBA:
case OSMESA_BGRA:
if (swrast->_RasterMask==(DEPTH_BIT|BLEND_BIT)
&& ctx->Depth.Func==GL_LESS
&& ctx->Depth.Mask==GL_TRUE
- && ctx->Visual.DepthBits == DEFAULT_SOFTWARE_DEPTH_BITS
+ && ctx->Visual.depthBits == DEFAULT_SOFTWARE_DEPTH_BITS
&& ctx->Color.BlendSrcRGB==GL_SRC_ALPHA
&& ctx->Color.BlendDstRGB==GL_ONE_MINUS_SRC_ALPHA
&& ctx->Color.BlendSrcA==GL_SRC_ALPHA
if (swrast->_RasterMask==(DEPTH_BIT|BLEND_BIT)
&& ctx->Depth.Func==GL_LESS
&& ctx->Depth.Mask==GL_FALSE
- && ctx->Visual.DepthBits == DEFAULT_SOFTWARE_DEPTH_BITS
+ && ctx->Visual.depthBits == DEFAULT_SOFTWARE_DEPTH_BITS
&& ctx->Color.BlendSrcRGB==GL_SRC_ALPHA
&& ctx->Color.BlendDstRGB==GL_ONE_MINUS_SRC_ALPHA
&& ctx->Color.BlendSrcA==GL_SRC_ALPHA
if (swrast->_RasterMask==DEPTH_BIT
&& ctx->Depth.Func==GL_LESS
&& ctx->Depth.Mask==GL_TRUE
- && ctx->Visual.DepthBits == DEFAULT_SOFTWARE_DEPTH_BITS
+ && ctx->Visual.depthBits == DEFAULT_SOFTWARE_DEPTH_BITS
&& osmesa->format!=OSMESA_COLOR_INDEX) {
if (ctx->Light.ShadeModel==GL_SMOOTH) {
return smooth_rgba_z_triangle;
-/* $Id: svgamesa.c,v 1.11 2000/12/26 05:09:30 keithw Exp $ */
+/* $Id: svgamesa.c,v 1.12 2001/01/23 23:39:36 brianp Exp $ */
/*
* Mesa 3-D graphics library
_mesa_enable_sw_extensions(ctx->gl_ctx);
ctx->gl_buffer = _mesa_create_framebuffer( ctx->gl_vis,
- ctx->gl_vis->DepthBits > 0,
- ctx->gl_vis->StencilBits > 0,
- ctx->gl_vis->AccumRedBits > 0,
- ctx->gl_vis->AlphaBits > 0 );
+ ctx->gl_vis->depthBits > 0,
+ ctx->gl_vis->stencilBits > 0,
+ ctx->gl_vis->accumRedBits > 0,
+ ctx->gl_vis->alphaBits > 0 );
ctx->width = ctx->height = 0; /* temporary until first "make-current" */
#endif
#ifndef DEV
_mesa_swapbuffers( SVGAMesa->gl_ctx );
- if (SVGAMesa->gl_vis->DBflag)
+ if (SVGAMesa->gl_vis->doubleBufferMode)
#endif /* DEV */
{
#ifdef SVGA_DEBUG
-/* $Id: fakeglx.c,v 1.44 2001/01/08 04:55:22 keithw Exp $ */
+/* $Id: fakeglx.c,v 1.45 2001/01/23 23:39:37 brianp Exp $ */
/*
* Mesa 3-D graphics library
if (v->display == dpy
&& v->level == level
&& v->ximage_flag == ximageFlag
- && v->gl_visual->RGBAflag == rgbFlag
- && v->gl_visual->DBflag == dbFlag
- && v->gl_visual->StereoFlag == stereoFlag
- && (v->gl_visual->AlphaBits > 0) == alphaFlag
- && (v->gl_visual->DepthBits >= depth_size || depth_size == 0)
- && (v->gl_visual->StencilBits >= stencil_size || stencil_size == 0)
- && (v->gl_visual->AccumRedBits >= accumRedSize || accumRedSize == 0)
- && (v->gl_visual->AccumGreenBits >= accumGreenSize || accumGreenSize == 0)
- && (v->gl_visual->AccumBlueBits >= accumBlueSize || accumBlueSize == 0)
- && (v->gl_visual->AccumAlphaBits >= accumAlphaSize || accumAlphaSize == 0)) {
+ && v->gl_visual->rgbMode == rgbFlag
+ && v->gl_visual->doubleBufferMode == dbFlag
+ && v->gl_visual->stereoMode == stereoFlag
+ && (v->gl_visual->alphaBits > 0) == alphaFlag
+ && (v->gl_visual->depthBits >= depth_size || depth_size == 0)
+ && (v->gl_visual->stencilBits >= stencil_size || stencil_size == 0)
+ && (v->gl_visual->accumRedBits >= accumRedSize || accumRedSize == 0)
+ && (v->gl_visual->accumGreenBits >= accumGreenSize || accumGreenSize == 0)
+ && (v->gl_visual->accumBlueBits >= accumBlueSize || accumBlueSize == 0)
+ && (v->gl_visual->accumAlphaBits >= accumAlphaSize || accumAlphaSize == 0)) {
/* now either compare XVisualInfo pointers or visual IDs */
if ((!comparePointers && v->visinfo->visualid == vinfo->visualid)
|| (comparePointers && v->vishandle == vinfo)) {
*value = glxvis->level;
return 0;
case GLX_RGBA:
- if (glxvis->gl_visual->RGBAflag) {
+ if (glxvis->gl_visual->rgbMode) {
*value = True;
}
else {
}
return 0;
case GLX_DOUBLEBUFFER:
- *value = (int) glxvis->gl_visual->DBflag;
+ *value = (int) glxvis->gl_visual->doubleBufferMode;
return 0;
case GLX_STEREO:
- *value = (int) glxvis->gl_visual->StereoFlag;
+ *value = (int) glxvis->gl_visual->stereoMode;
return 0;
case GLX_AUX_BUFFERS:
*value = (int) False;
return 0;
case GLX_RED_SIZE:
- *value = glxvis->gl_visual->RedBits;
+ *value = glxvis->gl_visual->redBits;
return 0;
case GLX_GREEN_SIZE:
- *value = glxvis->gl_visual->GreenBits;
+ *value = glxvis->gl_visual->greenBits;
return 0;
case GLX_BLUE_SIZE:
- *value = glxvis->gl_visual->BlueBits;
+ *value = glxvis->gl_visual->blueBits;
return 0;
case GLX_ALPHA_SIZE:
- *value = glxvis->gl_visual->AlphaBits;
+ *value = glxvis->gl_visual->alphaBits;
return 0;
case GLX_DEPTH_SIZE:
- *value = glxvis->gl_visual->DepthBits;
+ *value = glxvis->gl_visual->depthBits;
return 0;
case GLX_STENCIL_SIZE:
- *value = glxvis->gl_visual->StencilBits;
+ *value = glxvis->gl_visual->stencilBits;
return 0;
case GLX_ACCUM_RED_SIZE:
- *value = glxvis->gl_visual->AccumRedBits;
+ *value = glxvis->gl_visual->accumRedBits;
return 0;
case GLX_ACCUM_GREEN_SIZE:
- *value = glxvis->gl_visual->AccumGreenBits;
+ *value = glxvis->gl_visual->accumGreenBits;
return 0;
case GLX_ACCUM_BLUE_SIZE:
- *value = glxvis->gl_visual->AccumBlueBits;
+ *value = glxvis->gl_visual->accumBlueBits;
return 0;
case GLX_ACCUM_ALPHA_SIZE:
- *value = glxvis->gl_visual->AccumAlphaBits;
+ *value = glxvis->gl_visual->accumAlphaBits;
return 0;
/*
}
else if (glxvis->level>0) {
/* overlay */
- if (glxvis->gl_visual->RGBAflag) {
+ if (glxvis->gl_visual->rgbMode) {
*value = GLX_TRANSPARENT_RGB_EXT;
}
else {
-/* $Id: xm_api.c,v 1.15 2001/01/08 04:55:22 keithw Exp $ */
+/* $Id: xm_api.c,v 1.16 2001/01/23 23:39:37 brianp Exp $ */
/*
* Mesa 3-D graphics library
prevBuffer = find_xmesa_buffer(v->display, cmap, buffer);
if (prevBuffer &&
- (buffer->xm_visual->gl_visual->RGBAflag ==
- prevBuffer->xm_visual->gl_visual->RGBAflag)) {
+ (buffer->xm_visual->gl_visual->rgbMode ==
+ prevBuffer->xm_visual->gl_visual->rgbMode)) {
/* Copy colormap stuff from previous XMesaBuffer which uses same
* X colormap. Do this to avoid time spent in noFaultXAllocColor.
*/
prevBuffer = find_xmesa_buffer(v->display, cmap, buffer);
if (prevBuffer &&
- (buffer->xm_visual->gl_visual->RGBAflag ==
- prevBuffer->xm_visual->gl_visual->RGBAflag)) {
+ (buffer->xm_visual->gl_visual->rgbMode ==
+ prevBuffer->xm_visual->gl_visual->rgbMode)) {
/* Copy colormap stuff from previous, matching XMesaBuffer.
* Do this to avoid time spent in noFaultXAllocColor.
*/
assert( v->gl_visual );
/* Setup for single/double buffering */
- if (v->gl_visual->DBflag) {
+ if (v->gl_visual->doubleBufferMode) {
/* Double buffered */
#ifndef XFree86Server
b->shm = check_for_xshm( v->display );
#endif
/* determine back buffer implementation */
- if (v->gl_visual->DBflag) {
+ if (v->gl_visual->doubleBufferMode) {
if (v->ximage_flag) {
b->db_state = BACK_XIMAGE;
}
}
b->gl_buffer = _mesa_create_framebuffer( v->gl_visual,
- v->gl_visual->DepthBits > 0,
- v->gl_visual->StencilBits > 0,
- v->gl_visual->AccumRedBits > 0,
- v->gl_visual->AlphaBits > 0 );
+ v->gl_visual->depthBits > 0,
+ v->gl_visual->stencilBits > 0,
+ v->gl_visual->accumRedBits > 0,
+ v->gl_visual->alphaBits > 0 );
if (!b->gl_buffer) {
free_xmesa_buffer(client, b);
return NULL;
}
- if (!initialize_visual_and_buffer( client, v, b, v->gl_visual->RGBAflag,
+ if (!initialize_visual_and_buffer( client, v, b, v->gl_visual->rgbMode,
(XMesaDrawable)w, b->cmap )) {
_mesa_destroy_framebuffer( b->gl_buffer );
free_xmesa_buffer(client, b);
int attribs[100];
int numAttribs = 0;
int hw;
- if (v->gl_visual->DepthBits > 0) {
+ if (v->gl_visual->depthBits > 0) {
attribs[numAttribs++] = FXMESA_DEPTH_SIZE;
attribs[numAttribs++] = 1;
}
- if (v->gl_visual->DBflag) {
+ if (v->gl_visual->doubleBufferMode) {
attribs[numAttribs++] = FXMESA_DOUBLEBUFFER;
}
- if (v->gl_visual->AccumRedBits > 0) {
+ if (v->gl_visual->accumRedBits > 0) {
attribs[numAttribs++] = FXMESA_ACCUM_SIZE;
- attribs[numAttribs++] = v->gl_visual->AccumRedBits;
+ attribs[numAttribs++] = v->gl_visual->accumRedBits;
}
- if (v->gl_visual->StencilBits > 0) {
+ if (v->gl_visual->stencilBits > 0) {
attribs[numAttribs++] = FXMESA_STENCIL_SIZE;
- attribs[numAttribs++] = v->gl_visual->StencilBits;
+ attribs[numAttribs++] = v->gl_visual->stencilBits;
}
- if (v->gl_visual->AlphaBits > 0) {
+ if (v->gl_visual->alphaBits > 0) {
attribs[numAttribs++] = FXMESA_ALPHA_SIZE;
attribs[numAttribs++] = 1;
}
b->cmap = cmap;
/* determine back buffer implementation */
- if (v->gl_visual->DBflag) {
+ if (v->gl_visual->doubleBufferMode) {
if (v->ximage_flag) {
b->db_state = BACK_XIMAGE;
}
}
b->gl_buffer = _mesa_create_framebuffer( v->gl_visual,
- v->gl_visual->DepthBits > 0,
- v->gl_visual->StencilBits > 0,
- v->gl_visual->AccumRedBits +
- v->gl_visual->AccumGreenBits +
- v->gl_visual->AccumBlueBits > 0,
- v->gl_visual->AlphaBits > 0 );
+ v->gl_visual->depthBits > 0,
+ v->gl_visual->stencilBits > 0,
+ v->gl_visual->accumRedBits +
+ v->gl_visual->accumGreenBits +
+ v->gl_visual->accumBlueBits > 0,
+ v->gl_visual->alphaBits > 0 );
if (!b->gl_buffer) {
free_xmesa_buffer(client, b);
return NULL;
}
- if (!initialize_visual_and_buffer(client, v, b, v->gl_visual->RGBAflag,
+ if (!initialize_visual_and_buffer(client, v, b, v->gl_visual->rgbMode,
(XMesaDrawable)p, cmap)) {
_mesa_destroy_framebuffer( b->gl_buffer );
free_xmesa_buffer(client, b);
c->gl_ctx->Scissor.Height = drawBuffer->height;
}
- if (c->xm_visual->gl_visual->RGBAflag) {
+ if (c->xm_visual->gl_visual->rgbMode) {
/*
* Must recompute and set these pixel values because colormap
* can be different for different windows.
-/* $Id: xm_line.c,v 1.15 2001/01/05 02:26:48 keithw Exp $ */
+/* $Id: xm_line.c,v 1.16 2001/01/23 23:39:37 brianp Exp $ */
/*
* Mesa 3-D graphics library
&& swrast->_RasterMask==DEPTH_BIT
&& ctx->Depth.Func==GL_LESS
&& ctx->Depth.Mask==GL_TRUE
- && ctx->Visual.DepthBits == DEFAULT_SOFTWARE_DEPTH_BITS
+ && ctx->Visual.depthBits == DEFAULT_SOFTWARE_DEPTH_BITS
&& ctx->Line.Width==1.0F) {
switch (xmesa->pixelformat) {
case PF_TRUECOLOR:
-/* $Id: xm_tri.c,v 1.16 2001/01/05 02:26:48 keithw Exp $ */
+/* $Id: xm_tri.c,v 1.17 2001/01/23 23:39:37 brianp Exp $ */
/*
* Mesa 3-D graphics library
#endif
+#ifdef DEBUG
+
+/* record the current triangle function name */
+static const char *triFuncName = NULL;
+
+#define USE(triFunc) \
+do { \
+ triFuncName = #triFunc; \
+ /*printf("%s\n", triFuncName);*/ \
+ return triFunc; \
+} while (0)
+
+#else
+
+#define USE(triFunc) return triFunc
+
+#endif
+
+
static swrast_tri_func get_triangle_func( GLcontext *ctx )
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
(void) kernel1;
+#ifdef DEBUG
+ triFuncName = NULL;
+#endif
+
if (ctx->RenderMode != GL_RENDER) return (swrast_tri_func) NULL;
if (ctx->Polygon.SmoothFlag) return (swrast_tri_func) NULL;
if (ctx->Texture._ReallyEnabled) return (swrast_tri_func) NULL;
&& swrast->_RasterMask==DEPTH_BIT
&& ctx->Depth.Func==GL_LESS
&& ctx->Depth.Mask==GL_TRUE
- && ctx->Visual.DepthBits == DEFAULT_SOFTWARE_DEPTH_BITS
+ && ctx->Visual.depthBits == DEFAULT_SOFTWARE_DEPTH_BITS
&& ctx->Polygon.StippleFlag==GL_FALSE) {
switch (xmesa->pixelformat) {
case PF_TRUECOLOR:
- return smooth_TRUECOLOR_z_triangle;
+ USE(smooth_TRUECOLOR_z_triangle);
case PF_8A8B8G8R:
- return smooth_8A8B8G8R_z_triangle;
+ USE(smooth_8A8B8G8R_z_triangle);
case PF_8R8G8B:
- return smooth_8R8G8B_z_triangle;
+ USE(smooth_8R8G8B_z_triangle);
case PF_8R8G8B24:
- return smooth_8R8G8B24_z_triangle;
+ USE(smooth_8R8G8B24_z_triangle);
case PF_TRUEDITHER:
- return smooth_TRUEDITHER_z_triangle;
+ USE(smooth_TRUEDITHER_z_triangle);
case PF_5R6G5B:
- return smooth_5R6G5B_z_triangle;
+ USE(smooth_5R6G5B_z_triangle);
case PF_DITHER_5R6G5B:
- return smooth_DITHER_5R6G5B_z_triangle;
+ USE(smooth_DITHER_5R6G5B_z_triangle);
case PF_HPCR:
- return smooth_HPCR_z_triangle;
+ USE(smooth_HPCR_z_triangle);
case PF_DITHER:
- return (depth==8) ? smooth_DITHER8_z_triangle
- : smooth_DITHER_z_triangle;
+ if (depth == 8)
+ USE(smooth_DITHER8_z_triangle);
+ else
+ USE(smooth_DITHER_z_triangle);
+ break;
case PF_LOOKUP:
- return (depth==8) ? smooth_LOOKUP8_z_triangle : (swrast_tri_func)NULL;
+ if (depth == 8)
+ USE(smooth_LOOKUP8_z_triangle);
+ else
+ return (swrast_tri_func) NULL;
default:
- return (swrast_tri_func)NULL;
+ return (swrast_tri_func) NULL;
}
}
if ( ctx->Light.ShadeModel==GL_FLAT
&& swrast->_RasterMask==DEPTH_BIT
&& ctx->Depth.Func==GL_LESS
&& ctx->Depth.Mask==GL_TRUE
- && ctx->Visual.DepthBits == DEFAULT_SOFTWARE_DEPTH_BITS
+ && ctx->Visual.depthBits == DEFAULT_SOFTWARE_DEPTH_BITS
&& ctx->Polygon.StippleFlag==GL_FALSE) {
switch (xmesa->pixelformat) {
case PF_TRUECOLOR:
- return flat_TRUECOLOR_z_triangle;
+ USE(flat_TRUECOLOR_z_triangle);
case PF_8A8B8G8R:
- return flat_8A8B8G8R_z_triangle;
+ USE(flat_8A8B8G8R_z_triangle);
case PF_8R8G8B:
- return flat_8R8G8B_z_triangle;
+ USE(flat_8R8G8B_z_triangle);
case PF_8R8G8B24:
- return flat_8R8G8B24_z_triangle;
+ USE(flat_8R8G8B24_z_triangle);
case PF_TRUEDITHER:
- return flat_TRUEDITHER_z_triangle;
+ USE(flat_TRUEDITHER_z_triangle);
case PF_5R6G5B:
- return flat_5R6G5B_z_triangle;
+ USE(flat_5R6G5B_z_triangle);
case PF_DITHER_5R6G5B:
- return flat_DITHER_5R6G5B_z_triangle;
+ USE(flat_DITHER_5R6G5B_z_triangle);
case PF_HPCR:
- return flat_HPCR_z_triangle;
+ USE(flat_HPCR_z_triangle);
case PF_DITHER:
- return (depth==8) ? flat_DITHER8_z_triangle
- : flat_DITHER_z_triangle;
+ if (depth == 8)
+ USE(flat_DITHER8_z_triangle);
+ else
+ USE(flat_DITHER_z_triangle);
+ break;
case PF_LOOKUP:
- return (depth==8) ? flat_LOOKUP8_z_triangle : (swrast_tri_func)NULL;
+ if (depth == 8)
+ USE(flat_LOOKUP8_z_triangle);
+ else
+ return (swrast_tri_func) NULL;
default:
- return (swrast_tri_func)NULL;
+ return (swrast_tri_func) NULL;
}
}
if ( swrast->_RasterMask==0 /* no depth test */
&& ctx->Polygon.StippleFlag==GL_FALSE) {
switch (xmesa->pixelformat) {
case PF_TRUECOLOR:
- return smooth_TRUECOLOR_triangle;
+ USE(smooth_TRUECOLOR_triangle);
case PF_8A8B8G8R:
- return smooth_8A8B8G8R_triangle;
+ USE(smooth_8A8B8G8R_triangle);
case PF_8R8G8B:
- return smooth_8R8G8B_triangle;
+ USE(smooth_8R8G8B_triangle);
case PF_8R8G8B24:
- return smooth_8R8G8B24_triangle;
+ USE(smooth_8R8G8B24_triangle);
case PF_TRUEDITHER:
- return smooth_TRUEDITHER_triangle;
+ USE(smooth_TRUEDITHER_triangle);
case PF_5R6G5B:
- return smooth_5R6G5B_triangle;
+ USE(smooth_5R6G5B_triangle);
case PF_DITHER_5R6G5B:
- return smooth_DITHER_5R6G5B_triangle;
+ USE(smooth_DITHER_5R6G5B_triangle);
case PF_HPCR:
- return smooth_HPCR_triangle;
+ USE(smooth_HPCR_triangle);
case PF_DITHER:
- return (depth==8) ? smooth_DITHER8_triangle
- : smooth_DITHER_triangle;
+ if (depth == 8)
+ USE(smooth_DITHER8_triangle);
+ else
+ USE(smooth_DITHER_triangle);
+ break;
case PF_LOOKUP:
- return (depth==8) ? smooth_LOOKUP8_triangle : (swrast_tri_func)NULL;
+ if (depth == 8)
+ USE(smooth_LOOKUP8_triangle);
+ else
+ return (swrast_tri_func) NULL;
default:
- return (swrast_tri_func)NULL;
+ return (swrast_tri_func) NULL;
}
}
&& ctx->Polygon.StippleFlag==GL_FALSE) {
switch (xmesa->pixelformat) {
case PF_TRUECOLOR:
- return flat_TRUECOLOR_triangle;
+ USE(flat_TRUECOLOR_triangle);
case PF_TRUEDITHER:
- return flat_TRUEDITHER_triangle;
+ USE(flat_TRUEDITHER_triangle);
case PF_8A8B8G8R:
- return flat_8A8B8G8R_triangle;
+ USE(flat_8A8B8G8R_triangle);
case PF_8R8G8B:
- return flat_8R8G8B_triangle;
+ USE(flat_8R8G8B_triangle);
case PF_8R8G8B24:
- return flat_8R8G8B24_triangle;
+ USE(flat_8R8G8B24_triangle);
case PF_5R6G5B:
- return flat_5R6G5B_triangle;
+ USE(flat_5R6G5B_triangle);
case PF_DITHER_5R6G5B:
- return flat_DITHER_5R6G5B_triangle;
+ USE(flat_DITHER_5R6G5B_triangle);
case PF_HPCR:
- return flat_HPCR_triangle;
+ USE(flat_HPCR_triangle);
case PF_DITHER:
- return (depth==8) ? flat_DITHER8_triangle
- : flat_DITHER_triangle;
+ if (depth == 8)
+ USE(flat_DITHER8_triangle);
+ else
+ USE(flat_DITHER_triangle);
+ break;
case PF_LOOKUP:
- return (depth==8) ? flat_LOOKUP8_triangle : (swrast_tri_func)NULL;
+ if (depth == 8)
+ USE(flat_LOOKUP8_triangle);
+ else
+ return (swrast_tri_func) NULL;
default:
- return (swrast_tri_func)NULL;
+ return (swrast_tri_func) NULL;
}
}
- return (swrast_tri_func)NULL;
+ return (swrast_tri_func) NULL;
}
else {
/* draw to pixmap */
-/* $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
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;
}
-/* $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"),
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);
-/* $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"),
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 );
}
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);
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;
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;
/*
* 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;
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;
}
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;
}
-/* $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"),
GLint accumAlphaBits,
GLint numSamples )
{
+ (void) numSamples;
+
assert(vis);
/* This is to catch bad values from device drivers not updated for
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;
}
/* 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;
#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
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;
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
-/* $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"),
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);
}
-/* $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
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;
}
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;
}
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;
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;
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;
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;
-/* $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"),
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:
-/* $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"),
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]);
*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);
*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);
*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);
*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);
*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);
}
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);
*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);
*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);
*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);
*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);
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];
*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;
*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;
*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;
*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);
*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;
}
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;
*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;
*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;
*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;
*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;
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];
*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;
*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;
*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;
*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);
*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;
}
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;
*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;
*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;
*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;
*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;
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] );
*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;
*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;
*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;
*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;
*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;
}
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;
*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;
*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;
*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;
*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;
-/* $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
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) {
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 */
{
/* 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);
-/* $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
* 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++) {
-/* $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"),
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;
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) {
-/* $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"),
*/
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;
-/*
- * 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.
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;
-/* $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"),
_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;
-/* $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"),
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;
}
_mesa_PolygonOffsetEXT( GLfloat factor, GLfloat bias )
{
GET_CURRENT_CONTEXT(ctx);
- _mesa_PolygonOffset(factor, bias * ctx->Visual.DepthMaxF );
+ _mesa_PolygonOffset(factor, bias * ctx->DepthMaxF );
}
-/* $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"),
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);
}
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]);
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;
-/* $Id: s_aaline.c,v 1.3 2000/11/22 07:32:18 joukj Exp $ */
+/* $Id: s_aaline.c,v 1.4 2001/01/23 23:39:37 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"),
ASSERT(ctx->Line.SmoothFlag);
- if (ctx->Visual.RGBAflag) {
+ if (ctx->Visual.rgbMode) {
/* RGBA */
if (ctx->Texture._ReallyEnabled) {
if (swrast->_MultiTextureEnabled
-/* $Id: s_aatriangle.c,v 1.5 2001/01/02 22:02:52 brianp Exp $ */
+/* $Id: s_aatriangle.c,v 1.6 2001/01/23 23:39:37 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"),
}
}
else {
- if (ctx->Visual.RGBAflag) {
+ if (ctx->Visual.rgbMode) {
SWRAST_CONTEXT(ctx)->Triangle = rgba_aa_tri;
}
else {
-/* $Id: s_accum.c,v 1.3 2000/11/13 20:02:57 keithw Exp $ */
+/* $Id: s_accum.c,v 1.4 2001/01/23 23:39:37 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"),
#include "mem.h"
#include "s_accum.h"
+#include "s_alphabuf.h"
#include "s_context.h"
#include "s_masking.h"
#include "s_span.h"
GLuint buffersize;
GLfloat acc_scale;
- if (ctx->Visual.AccumRedBits==0) {
+ if (ctx->Visual.accumRedBits==0) {
/* No accumulation buffer! */
return;
}
}
(*ctx->Driver.WriteRGBASpan)( ctx, width, xpos, ypos,
(const GLchan (*)[4])rgba, NULL );
+ if (ctx->DrawBuffer->UseSoftwareAlphaBuffers
+ && ctx->Color.ColorMask[ACOMP]) {
+ _mesa_write_alpha_span(ctx, width, xpos, ypos,
+ (CONST GLubyte (*)[4]) rgba, NULL);
+ }
ypos++;
}
}
}
(*ctx->Driver.WriteRGBASpan)( ctx, width, xpos, ypos,
(const GLchan (*)[4])rgba, NULL );
+ if (ctx->DrawBuffer->UseSoftwareAlphaBuffers
+ && ctx->Color.ColorMask[ACOMP]) {
+ _mesa_write_alpha_span(ctx, width, xpos, ypos,
+ (CONST GLubyte (*)[4]) rgba, NULL);
+ }
ypos++;
}
}
+/* $Id: s_alphabuf.c,v 1.3 2001/01/23 23:39:37 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"),
"Couldn't allocate front-left alpha buffer" );
}
- if (ctx->Visual.DBflag) {
+ if (ctx->Visual.doubleBufferMode) {
if (buf->BackLeftAlpha) {
FREE( buf->BackLeftAlpha );
}
}
}
- if (ctx->Visual.StereoFlag) {
+ if (ctx->Visual.stereoMode) {
if (buf->FrontRightAlpha) {
FREE( buf->FrontRightAlpha );
}
"Couldn't allocate front-right alpha buffer" );
}
- if (ctx->Visual.DBflag) {
+ if (ctx->Visual.doubleBufferMode) {
if (buf->BackRightAlpha) {
FREE( buf->BackRightAlpha );
}
-/* $Id: s_bitmap.c,v 1.3 2000/11/16 21:05:41 keithw Exp $ */
+/* $Id: s_bitmap.c,v 1.4 2001/01/23 23:39:37 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.3
+ * Version: 3.5
*
- * Copyright (C) 1999 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"),
_swrast_validate_derived( ctx );
/* Set bitmap drawing color */
- if (ctx->Visual.RGBAflag) {
+ if (ctx->Visual.rgbMode) {
GLint r, g, b, a;
r = (GLint) (ctx->Current.RasterColor[0] * CHAN_MAXF);
g = (GLint) (ctx->Current.RasterColor[1] * CHAN_MAXF);
PB_SET_INDEX( PB, ctx->Current.RasterIndex );
}
- fragZ = (GLdepth) ( ctx->Current.RasterPos[2] * ctx->Visual.DepthMaxF);
+ fragZ = (GLdepth) ( ctx->Current.RasterPos[2] * ctx->DepthMaxF);
_mesa_win_fog_coords_from_z( ctx, 1, &fragZ, &fogCoord );
-/* $Id: s_buffers.c,v 1.2 2000/11/13 20:02:57 keithw Exp $ */
+/* $Id: s_buffers.c,v 1.3 2001/01/23 23:39:37 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"),
const GLint height = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin;
const GLint width = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin;
- if (ctx->Visual.RGBAflag) {
+ if (ctx->Visual.rgbMode) {
/* RGBA mode */
const GLchan r = (GLint) (ctx->Color.ClearColor[0] * CHAN_MAXF);
const GLchan g = (GLint) (ctx->Color.ClearColor[1] * CHAN_MAXF);
const GLint height = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin;
const GLint width = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin;
- if (ctx->Visual.RGBAflag) {
+ if (ctx->Visual.rgbMode) {
/* RGBA mode */
const GLchan r = (GLint) (ctx->Color.ClearColor[0] * CHAN_MAXF);
const GLchan g = (GLint) (ctx->Color.ClearColor[1] * CHAN_MAXF);
else {
/* Color index mode */
ASSERT(ctx->Color.IndexMask == ~0);
- if (ctx->Visual.IndexBits == 8) {
+ if (ctx->Visual.indexBits == 8) {
/* 8-bit clear */
GLubyte span[MAX_WIDTH];
GLint i;
-/* $Id: s_context.c,v 1.10 2001/01/13 07:13:28 keithw Exp $ */
+/* $Id: s_context.c,v 1.11 2001/01/23 23:39:37 brianp Exp $ */
/*
* Mesa 3-D graphics library
if (ctx->Fog.Enabled) RasterMask |= FOG_BIT;
if (ctx->Scissor.Enabled) RasterMask |= SCISSOR_BIT;
if (ctx->Stencil.Enabled) RasterMask |= STENCIL_BIT;
- if (ctx->Visual.RGBAflag) {
+ if (ctx->Visual.rgbMode) {
const GLuint colorMask = *((GLuint *) &ctx->Color.ColorMask);
if (colorMask != 0xffffffff) RasterMask |= MASKING_BIT;
if (ctx->Color.ColorLogicOpEnabled) RasterMask |= LOGIC_OP_BIT;
else if (ctx->Color.DrawBuffer==GL_NONE) {
RasterMask |= MULTI_DRAW_BIT;
}
- else if (ctx->Visual.RGBAflag && *((GLuint *) ctx->Color.ColorMask) == 0) {
+ else if (ctx->Visual.rgbMode && *((GLuint *) ctx->Color.ColorMask) == 0) {
RasterMask |= MULTI_DRAW_BIT; /* all RGBA channels disabled */
}
- else if (!ctx->Visual.RGBAflag && ctx->Color.IndexMask==0) {
+ else if (!ctx->Visual.rgbMode && ctx->Color.IndexMask==0) {
RasterMask |= MULTI_DRAW_BIT; /* all color index bits disabled */
}
-/* $Id: s_copypix.c,v 1.9 2001/01/05 21:28:31 brianp Exp $ */
+/* $Id: s_copypix.c,v 1.10 2001/01/23 23:39:37 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"),
if (ctx->Depth.Test || ctx->Fog.Enabled) {
/* fill in array of z values */
GLdepth z = (GLdepth)
- (ctx->Current.RasterPos[2] * ctx->Visual.DepthMax);
+ (ctx->Current.RasterPos[2] * ctx->DepthMax);
GLint i;
for (i = 0; i < width; i++) {
zspan[i] = z;
if (ctx->Depth.Test || ctx->Fog.Enabled) {
/* fill in array of z values */
- GLdepth z = (GLdepth) (ctx->Current.RasterPos[2] * ctx->Visual.DepthMax);
+ GLdepth z = (GLdepth) (ctx->Current.RasterPos[2] * ctx->DepthMax);
for (i=0;i<width;i++) {
zspan[i] = z;
}
if (ctx->Depth.Test || ctx->Fog.Enabled) {
/* fill in array of z values */
- GLdepth z = (GLdepth) (ctx->Current.RasterPos[2] * ctx->Visual.DepthMax);
+ GLdepth z = (GLdepth) (ctx->Current.RasterPos[2] * ctx->DepthMax);
for (i=0;i<width;i++) {
zspan[i] = z;
}
const GLboolean zoom = ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F;
GLint overlapping;
- if (!ctx->Visual.DepthBits) {
+ if (!ctx->Visual.depthBits) {
gl_error( ctx, GL_INVALID_OPERATION, "glCopyPixels" );
return;
}
ctx->Pixel.ZoomX, ctx->Pixel.ZoomY);
/* setup colors or indexes */
- if (ctx->Visual.RGBAflag) {
+ if (ctx->Visual.rgbMode) {
GLuint *rgba32 = (GLuint *) rgba;
GLuint color = *(GLuint*)( ctx->Current.Color );
for (i = 0; i < width; i++) {
for (i = 0; i < width; i++) {
GLfloat d = depth[i] * ctx->Pixel.DepthScale + ctx->Pixel.DepthBias;
- zspan[i] = (GLdepth) (CLAMP(d, 0.0F, 1.0F) * ctx->Visual.DepthMax);
+ zspan[i] = (GLdepth) (CLAMP(d, 0.0F, 1.0F) * ctx->DepthMax);
}
- if (ctx->Visual.RGBAflag) {
+ if (ctx->Visual.rgbMode) {
if (zoom) {
gl_write_zoomed_rgba_span( ctx, width, destx, dy, zspan, 0,
(const GLchan (*)[4])rgba, desty );
const GLboolean shift_or_offset = ctx->Pixel.IndexShift || ctx->Pixel.IndexOffset;
GLint overlapping;
- if (!ctx->Visual.StencilBits) {
+ if (!ctx->Visual.stencilBits) {
gl_error( ctx, GL_INVALID_OPERATION, "glCopyPixels" );
return;
}
if (SWRAST_CONTEXT(ctx)->NewState)
_swrast_validate_derived( ctx );
- if (type == GL_COLOR && ctx->Visual.RGBAflag) {
+ if (type == GL_COLOR && ctx->Visual.rgbMode) {
copy_rgba_pixels( ctx, srcx, srcy, width, height, destx, desty );
}
- else if (type == GL_COLOR && !ctx->Visual.RGBAflag) {
+ else if (type == GL_COLOR && !ctx->Visual.rgbMode) {
copy_ci_pixels( ctx, srcx, srcy, width, height, destx, desty );
}
else if (type == GL_DEPTH) {
-/* $Id: s_depth.c,v 1.3 2000/11/13 20:02:57 keithw Exp $ */
+/* $Id: s_depth.c,v 1.4 2001/01/23 23:39:37 brianp Exp $ */
/*
* Mesa 3-D graphics library
GLvoid *
_mesa_zbuffer_address(GLcontext *ctx, GLint x, GLint y)
{
- if (ctx->Visual.DepthBits <= 16)
+ if (ctx->Visual.depthBits <= 16)
return (GLushort *) ctx->DrawBuffer->DepthBuffer + ctx->DrawBuffer->Width * y + x;
else
return (GLuint *) ctx->DrawBuffer->DepthBuffer + ctx->DrawBuffer->Width * y + x;
}
else {
/* software depth buffer */
- if (ctx->Visual.DepthBits <= 16) {
+ if (ctx->Visual.depthBits <= 16) {
GLushort *zptr = (GLushort *) Z_ADDRESS16(ctx, x, y);
GLuint passed = depth_test_span16(ctx, n, x, y, zptr, z, mask);
return passed;
}
else {
/* software depth testing */
- if (ctx->Visual.DepthBits <= 16)
+ if (ctx->Visual.depthBits <= 16)
software_depth_test_pixels16(ctx, n, x, y, z, mask);
else
software_depth_test_pixels32(ctx, n, x, y, z, mask);
if (ctx->DrawBuffer->DepthBuffer) {
/* read from software depth buffer */
- if (ctx->Visual.DepthBits <= 16) {
+ if (ctx->Visual.depthBits <= 16) {
const GLushort *zptr = Z_ADDRESS16( ctx, x, y );
GLuint i;
for (i = 0; i < n; i++) {
_mesa_read_depth_span_float( GLcontext *ctx,
GLint n, GLint x, GLint y, GLfloat depth[] )
{
- const GLfloat scale = 1.0F / ctx->Visual.DepthMaxF;
+ const GLfloat scale = 1.0F / ctx->DepthMaxF;
if (y < 0 || y >= ctx->DrawBuffer->Height ||
x + (GLint) n <= 0 || x >= ctx->DrawBuffer->Width) {
if (ctx->DrawBuffer->DepthBuffer) {
/* read from software depth buffer */
- if (ctx->Visual.DepthBits <= 16) {
+ if (ctx->Visual.depthBits <= 16) {
const GLushort *zptr = Z_ADDRESS16( ctx, x, y );
GLuint i;
for (i = 0; i < n; i++) {
}
/* allocate new depth buffer, but don't initialize it */
- if (ctx->Visual.DepthBits <= 16)
+ if (ctx->Visual.depthBits <= 16)
bytesPerValue = sizeof(GLushort);
else
bytesPerValue = sizeof(GLuint);
void
_mesa_clear_depth_buffer( GLcontext *ctx )
{
- if (ctx->Visual.DepthBits == 0
+ if (ctx->Visual.depthBits == 0
|| !ctx->DrawBuffer->DepthBuffer
|| !ctx->Depth.Mask) {
/* no depth buffer, or writing to it is disabled */
if (ctx->Scissor.Enabled) {
/* only clear scissor region */
- if (ctx->Visual.DepthBits <= 16) {
- const GLushort clearValue = (GLushort) (ctx->Depth.Clear * ctx->Visual.DepthMax);
+ if (ctx->Visual.depthBits <= 16) {
+ const GLushort clearValue = (GLushort) (ctx->Depth.Clear * ctx->DepthMax);
const GLint rows = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin;
const GLint width = ctx->DrawBuffer->Width;
GLushort *dRow = (GLushort *) ctx->DrawBuffer->DepthBuffer
}
}
else {
- const GLuint clearValue = (GLuint) (ctx->Depth.Clear * ctx->Visual.DepthMax);
+ const GLuint clearValue = (GLuint) (ctx->Depth.Clear * ctx->DepthMax);
const GLint rows = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin;
const GLint width = ctx->DrawBuffer->Width;
GLuint *dRow = (GLuint *) ctx->DrawBuffer->DepthBuffer
}
else {
/* clear whole buffer */
- if (ctx->Visual.DepthBits <= 16) {
- const GLushort clearValue = (GLushort) (ctx->Depth.Clear * ctx->Visual.DepthMax);
+ if (ctx->Visual.depthBits <= 16) {
+ const GLushort clearValue = (GLushort) (ctx->Depth.Clear * ctx->DepthMax);
if ((clearValue & 0xff) == (clearValue >> 8)) {
if (clearValue == 0) {
BZERO(ctx->DrawBuffer->DepthBuffer,
}
else {
/* >16 bit depth buffer */
- const GLuint clearValue = (GLuint) (ctx->Depth.Clear * ctx->Visual.DepthMax);
+ const GLuint clearValue = (GLuint) (ctx->Depth.Clear * ctx->DepthMax);
if (clearValue == 0) {
BZERO(ctx->DrawBuffer->DepthBuffer,
ctx->DrawBuffer->Width*ctx->DrawBuffer->Height*sizeof(GLuint));
-/* $Id: s_drawpix.c,v 1.7 2001/01/05 21:28:31 brianp Exp $ */
+/* $Id: s_drawpix.c,v 1.8 2001/01/23 23:39:37 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"),
}
else {
/* setup array of fragment Z value to pass to zoom function */
- GLdepth z = (GLdepth) (ctx->Current.RasterPos[2] * ctx->Visual.DepthMaxF);
+ GLdepth z = (GLdepth) (ctx->Current.RasterPos[2] * ctx->DepthMaxF);
GLint i;
ASSERT(drawWidth < MAX_WIDTH);
for (i=0; i<drawWidth; i++)
if (format == GL_RGBA && type == CHAN_TYPE
&& ctx->_ImageTransferState==0) {
- if (ctx->Visual.RGBAflag) {
+ if (ctx->Visual.rgbMode) {
GLchan *src = (GLchan *) pixels
+ (skipRows * rowLength + skipPixels) * 4;
if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==1.0F) {
}
else if (format == GL_RGB && type == CHAN_TYPE
&& ctx->_ImageTransferState == 0) {
- if (ctx->Visual.RGBAflag) {
+ if (ctx->Visual.rgbMode) {
GLchan *src = (GLchan *) pixels
+ (skipRows * rowLength + skipPixels) * 3;
if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==1.0F) {
}
else if (format == GL_LUMINANCE && type == CHAN_TYPE
&& ctx->_ImageTransferState==0) {
- if (ctx->Visual.RGBAflag) {
+ if (ctx->Visual.rgbMode) {
GLchan *src = (GLchan *) pixels
+ (skipRows * rowLength + skipPixels);
if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==1.0F) {
}
else if (format == GL_LUMINANCE_ALPHA && type == CHAN_TYPE
&& ctx->_ImageTransferState == 0) {
- if (ctx->Visual.RGBAflag) {
+ if (ctx->Visual.rgbMode) {
GLchan *src = (GLchan *) pixels
+ (skipRows * rowLength + skipPixels)*2;
if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==1.0F) {
}
else if (format==GL_COLOR_INDEX && type==GL_UNSIGNED_BYTE) {
GLubyte *src = (GLubyte *) pixels + skipRows * rowLength + skipPixels;
- if (ctx->Visual.RGBAflag) {
+ if (ctx->Visual.rgbMode) {
/* convert CI data to RGBA */
if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==1.0F) {
/* no zooming */
/* Fragment depth values */
if (ctx->Depth.Test || ctx->Fog.Enabled) {
- GLdepth zval = (GLdepth) (ctx->Current.RasterPos[2] * ctx->Visual.DepthMaxF);
+ GLdepth zval = (GLdepth) (ctx->Current.RasterPos[2] * ctx->DepthMaxF);
GLint i;
for (i = 0; i < drawWidth; i++) {
zspan[i] = zval;
}
/* Colors or indexes */
- if (ctx->Visual.RGBAflag) {
+ if (ctx->Visual.rgbMode) {
GLint i;
GLint r, g, b, a;
UNCLAMPED_FLOAT_TO_CHAN(r, ctx->Current.RasterColor[0]);
}
if (type==GL_UNSIGNED_SHORT && sizeof(GLdepth)==sizeof(GLushort)
- && !bias_or_scale && !zoom && ctx->Visual.RGBAflag) {
+ && !bias_or_scale && !zoom && ctx->Visual.rgbMode) {
/* Special case: directly write 16-bit depth values */
GLint row;
for (row = 0; row < height; row++, y++) {
gl_write_rgba_span( ctx, width, x, y, zspan, 0, rgba, GL_BITMAP );
}
}
- else if (type==GL_UNSIGNED_INT && ctx->Visual.DepthBits == 32
- && !bias_or_scale && !zoom && ctx->Visual.RGBAflag) {
+ else if (type==GL_UNSIGNED_INT && ctx->Visual.depthBits == 32
+ && !bias_or_scale && !zoom && ctx->Visual.rgbMode) {
/* Special case: directly write 32-bit depth values */
GLint row;
for (row = 0; row < height; row++, y++) {
pixels, width, height, GL_DEPTH_COMPONENT, type, 0, row, 0);
_mesa_unpack_depth_span( ctx, drawWidth, zspan, type, src,
&ctx->Unpack, ctx->_ImageTransferState );
- if (ctx->Visual.RGBAflag) {
+ if (ctx->Visual.rgbMode) {
if (zoom) {
gl_write_zoomed_rgba_span(ctx, width, x, y, zspan, 0,
(const GLchan (*)[4]) rgba, desty);
/* Fragment depth values */
if (ctx->Depth.Test || ctx->Fog.Enabled) {
/* fill in array of z values */
- GLdepth z = (GLdepth) (ctx->Current.RasterPos[2] * ctx->Visual.DepthMaxF);
+ GLdepth z = (GLdepth) (ctx->Current.RasterPos[2] * ctx->DepthMaxF);
GLint i;
for (i=0;i<width;i++) {
zspan[i] = z;
draw_depth_pixels( ctx, x, y, width, height, type, pixels );
break;
case GL_COLOR_INDEX:
- if (ctx->Visual.RGBAflag)
+ if (ctx->Visual.rgbMode)
draw_rgba_pixels(ctx, x,y, width, height, format, type, pixels);
else
draw_index_pixels(ctx, x, y, width, height, type, pixels);
-/* $Id: s_feedback.c,v 1.4 2001/01/05 02:26:49 keithw Exp $ */
+/* $Id: s_feedback.c,v 1.5 2001/01/23 23:39:37 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"),
win[0] = v->win[0];
win[1] = v->win[1];
- win[2] = v->win[2] / ctx->Visual.DepthMaxF;
+ win[2] = v->win[2] / ctx->DepthMaxF;
win[3] = 1.0 / v->win[3];
color[0] = CHAN_TO_FLOAT(pv->color[0]);
const SWvertex *v2)
{
if (gl_cull_triangle( ctx, v0, v1, v2 )) {
- const GLfloat zs = 1.0F / ctx->Visual.DepthMaxF;
+ const GLfloat zs = 1.0F / ctx->DepthMaxF;
gl_update_hitflag( ctx, v0->win[2] * zs );
gl_update_hitflag( ctx, v1->win[2] * zs );
void gl_select_line( GLcontext *ctx, const SWvertex *v0, const SWvertex *v1 )
{
- const GLfloat zs = 1.0F / ctx->Visual.DepthMaxF;
+ const GLfloat zs = 1.0F / ctx->DepthMaxF;
gl_update_hitflag( ctx, v0->win[2] * zs );
gl_update_hitflag( ctx, v1->win[2] * zs );
}
void gl_select_point( GLcontext *ctx, const SWvertex *v )
{
- const GLfloat zs = 1.0F / ctx->Visual.DepthMaxF;
+ const GLfloat zs = 1.0F / ctx->DepthMaxF;
gl_update_hitflag( ctx, v->win[2] * zs );
}
-/* $Id: s_lines.c,v 1.9 2001/01/13 07:13:28 keithw Exp $ */
+/* $Id: s_lines.c,v 1.10 2001/01/23 23:39:37 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"),
_swrast_choose_line( GLcontext *ctx )
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
- const GLboolean rgbmode = ctx->Visual.RGBAflag;
+ const GLboolean rgbmode = ctx->Visual.rgbMode;
if (ctx->RenderMode==GL_RENDER) {
if (ctx->Line.SmoothFlag) {
-/* $Id: s_linetemp.h,v 1.3 2000/11/19 23:10:26 brianp Exp $ */
+/* $Id: s_linetemp.h,v 1.4 2001/01/23 23:39:37 brianp Exp $ */
/*
* Mesa 3-D graphics library
#endif
#ifdef INTERP_Z
GLint z0, z1, dz;
- const GLint depthBits = ctx->Visual.DepthBits;
+ const GLint depthBits = ctx->Visual.depthBits;
const GLint fixedToDepthShift = depthBits <= 16 ? FIXED_SHIFT : 0;
# define FixedToDepth(F) ((F) >> fixedToDepthShift)
# ifdef DEPTH_TYPE
-/* $Id: s_points.c,v 1.11 2001/01/04 15:32:10 brianp Exp $ */
+/* $Id: s_points.c,v 1.12 2001/01/23 23:39:37 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"),
_swrast_choose_point( GLcontext *ctx )
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
- GLboolean rgbMode = ctx->Visual.RGBAflag;
+ GLboolean rgbMode = ctx->Visual.rgbMode;
if (ctx->RenderMode==GL_RENDER) {
if (ctx->Point.SpriteMode) {
-/* $Id: s_readpix.c,v 1.5 2000/12/13 00:46:22 brianp Exp $ */
+/* $Id: s_readpix.c,v 1.6 2001/01/23 23:39:37 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"),
GLint i, j, readWidth;
/* error checking */
- if (ctx->Visual.RGBAflag) {
+ if (ctx->Visual.rgbMode) {
gl_error( ctx, GL_INVALID_OPERATION, "glReadPixels" );
return;
}
GLboolean bias_or_scale;
/* Error checking */
- if (ctx->Visual.DepthBits <= 0) {
+ if (ctx->Visual.depthBits <= 0) {
/* No depth buffer */
gl_error( ctx, GL_INVALID_OPERATION, "glReadPixels" );
return;
bias_or_scale = ctx->Pixel.DepthBias!=0.0 || ctx->Pixel.DepthScale!=1.0;
- if (type==GL_UNSIGNED_SHORT && ctx->Visual.DepthBits == 16
+ if (type==GL_UNSIGNED_SHORT && ctx->Visual.depthBits == 16
&& !bias_or_scale && !packing->SwapBytes) {
/* Special case: directly read 16-bit unsigned depth values. */
for (j=0;j<height;j++,y++) {
dst[i] = depth[i];
}
}
- else if (type==GL_UNSIGNED_INT && ctx->Visual.DepthBits == 32
+ else if (type==GL_UNSIGNED_INT && ctx->Visual.depthBits == 32
&& !bias_or_scale && !packing->SwapBytes) {
/* Special case: directly read 32-bit unsigned depth values. */
for (j=0;j<height;j++,y++) {
readWidth = (width > MAX_WIDTH) ? MAX_WIDTH : width;
- if (ctx->Visual.StencilBits<=0) {
+ if (ctx->Visual.stencilBits <= 0) {
/* No stencil buffer */
gl_error( ctx, GL_INVALID_OPERATION, "glReadPixels" );
return;
dest = tmpImage;
for (row = 0; row < height; row++, y++) {
GLchan rgba[MAX_WIDTH][4];
- if (ctx->Visual.RGBAflag) {
+ if (ctx->Visual.rgbMode) {
gl_read_rgba_span(ctx, ctx->ReadBuffer, readWidth, x, y, rgba);
}
else {
for (row = 0; row < height; row++, y++) {
GLchan rgba[MAX_WIDTH][4];
GLvoid *dst;
- if (ctx->Visual.RGBAflag) {
+ if (ctx->Visual.rgbMode) {
gl_read_rgba_span(ctx, ctx->ReadBuffer, readWidth, x, y, rgba);
}
else {
}
dst = _mesa_image_address(packing, pixels, width, height,
format, type, 0, row, 0);
- if (ctx->Visual.RedBits < CHAN_BITS ||
- ctx->Visual.GreenBits < CHAN_BITS ||
- ctx->Visual.BlueBits < CHAN_BITS) {
+ if (ctx->Visual.redBits < CHAN_BITS ||
+ ctx->Visual.greenBits < CHAN_BITS ||
+ ctx->Visual.blueBits < CHAN_BITS) {
/* Requantize the color values into floating point and go from
* there. This fixes conformance failures with 16-bit color
* buffers, for example.
-/* $Id: s_stencil.c,v 1.4 2000/11/28 21:34:04 brianp Exp $ */
+/* $Id: s_stencil.c,v 1.5 2001/01/23 23:39:37 brianp Exp $ */
/*
* Mesa 3-D graphics library
static void
clear_software_stencil_buffer( GLcontext *ctx )
{
- if (ctx->Visual.StencilBits==0 || !ctx->DrawBuffer->Stencil) {
+ if (ctx->Visual.stencilBits==0 || !ctx->DrawBuffer->Stencil) {
/* no stencil buffer */
return;
}
-/* $Id: s_triangle.c,v 1.8 2001/01/05 02:26:49 keithw Exp $ */
+/* $Id: s_triangle.c,v 1.9 2001/01/23 23:39:37 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"),
_swrast_choose_triangle( GLcontext *ctx )
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
- const GLboolean rgbmode = ctx->Visual.RGBAflag;
+ const GLboolean rgbmode = ctx->Visual.rgbMode;
if (ctx->RenderMode==GL_RENDER) {
-/* $Id: s_tritemp.h,v 1.6 2000/12/08 00:09:24 brianp Exp $ */
+/* $Id: s_tritemp.h,v 1.7 2001/01/23 23:39:37 brianp Exp $ */
/*
* Mesa 3-D graphics library
} EdgeT;
#ifdef INTERP_Z
- const GLint depthBits = ctx->Visual.DepthBits;
+ const GLint depthBits = ctx->Visual.depthBits;
const GLint fixedToDepthShift = depthBits <= 16 ? FIXED_SHIFT : 0;
- const GLfloat maxDepth = ctx->Visual.DepthMaxF;
+ const GLfloat maxDepth = ctx->DepthMaxF;
#define FixedToDepth(F) ((F) >> fixedToDepthShift)
#endif
EdgeT eMaj, eTop, eBot;
if (ctx->_TriangleCaps & DD_TRI_UNFILLED)
ind |= SS_UNFILLED_BIT;
- if (ctx->Visual.RGBAflag)
+ if (ctx->Visual.rgbMode)
ind |= SS_RGBA_BIT;
swsetup->Triangle = tri_tab[ind];
if (bc < 0.0f) bc = -bc;
offset += MAX2(ac, bc) * ctx->Polygon.OffsetFactor;
}
+ offset *= ctx->MRD;
+ /*printf("offset %g\n", offset);*/
}
}
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999 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"),
int funcindex = 0;
if (ctx->RenderMode == GL_RENDER) {
- if (ctx->Visual.RGBAflag) {
+ if (ctx->Visual.rgbMode) {
funcindex = COLOR;
if (ctx->Texture._ReallyEnabled & ~0xf)
funcindex |= FOG;
}
else if (ctx->RenderMode == GL_FEEDBACK) {
- if (ctx->Visual.RGBAflag)
+ if (ctx->Visual.rgbMode)
funcindex = (COLOR | TEX0); /* is feedback color subject to fogging? */
else
funcindex = (INDEX | TEX0);
-/* $Id: t_vb_light.c,v 1.3 2001/01/08 04:09:42 keithw Exp $ */
+/* $Id: t_vb_light.c,v 1.4 2001/01/23 23:39:37 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"),
GLuint ind = 0;
light_func *tab;
- if (ctx->Visual.RGBAflag) {
+ if (ctx->Visual.rgbMode) {
if (ctx->Light._NeedVertices) {
if (ctx->Light.Model.ColorControl==GL_SEPARATE_SPECULAR_COLOR)
tab = _tnl_light_spec_tab;
-/* $Id: t_vb_render.c,v 1.10 2001/01/16 05:29:43 keithw Exp $ */
+/* $Id: t_vb_render.c,v 1.11 2001/01/23 23:39:37 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"),
GLuint inputs = VERT_CLIP;
GLuint i;
- if (ctx->Visual.RGBAflag)
- {
+ if (ctx->Visual.rgbMode) {
interp |= INTERP_RGBA;
inputs |= VERT_RGBA;