-/* $Id: buffers.c,v 1.7 2000/04/22 01:03:22 brianp Exp $ */
/*
* Mesa 3-D graphics library
_mesa_Clear( GLbitfield mask )
{
GET_CURRENT_CONTEXT(ctx);
+#ifdef PROFILE
+ GLdouble t0 = gl_time();
+#endif
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glClear");
if (MESA_VERBOSE & VERBOSE_API)
}
/* clear software-based alpha buffer(s) */
- if ( (mask & GL_COLOR_BUFFER_BIT) && ctx->Visual->SoftwareAlpha
+ if ( (mask & GL_COLOR_BUFFER_BIT)
+ && ctx->DrawBuffer->UseSoftwareAlphaBuffers
&& ctx->Color.ColorMask[RCOMP]) {
_mesa_clear_alpha_buffers( ctx );
}
+
+#ifdef PROFILE
+ ctx->ClearTime += gl_time() - t0;
+ ctx->ClearCount++;
+#endif
}
}
/*
* Set current alpha buffer pointer
*/
- if (ctx->Visual->SoftwareAlpha) {
+ if (ctx->DrawBuffer->UseSoftwareAlphaBuffers) {
if (ctx->Color.DriverDrawBuffer == GL_FRONT_LEFT)
ctx->DrawBuffer->Alpha = ctx->DrawBuffer->FrontLeftAlpha;
else if (ctx->Color.DriverDrawBuffer == GL_BACK_LEFT)
if (ctx->DrawBuffer->UseSoftwareAccumBuffer) {
_mesa_alloc_accum_buffer( ctx );
}
- if (ctx->Visual->SoftwareAlpha) {
+ if (ctx->DrawBuffer->UseSoftwareAlphaBuffers) {
_mesa_alloc_alpha_buffers( ctx );
}
}
-/* $Id: context.c,v 1.61 2000/04/22 01:05:00 brianp Exp $ */
+/* $Id: context.c,v 1.62 2000/05/04 13:53:55 brianp Exp $ */
/*
* Mesa 3-D graphics library
/*
* Allocate a new GLvisual object.
* Input: rgbFlag - GL_TRUE=RGB(A) mode, GL_FALSE=Color Index mode
- * alphaFlag - alloc software alpha buffers?
* dbFlag - double buffering?
* stereoFlag - stereo buffer?
* depthBits - requested bits per depth buffer value
*/
GLvisual *
_mesa_create_visual( GLboolean rgbFlag,
- GLboolean alphaFlag,
GLboolean dbFlag,
GLboolean stereoFlag,
GLint redBits,
{
GLvisual *vis = (GLvisual *) CALLOC( sizeof(GLvisual) );
if (vis) {
- if (!_mesa_initialize_visual(vis, rgbFlag, alphaFlag, dbFlag, stereoFlag,
+ if (!_mesa_initialize_visual(vis, rgbFlag, dbFlag, stereoFlag,
redBits, greenBits, blueBits, alphaBits,
indexBits, depthBits, stencilBits,
accumRedBits, accumGreenBits,
GLboolean
_mesa_initialize_visual( GLvisual *vis,
GLboolean rgbFlag,
- GLboolean alphaFlag,
GLboolean dbFlag,
GLboolean stereoFlag,
GLint redBits,
vis->RedBits = redBits;
vis->GreenBits = greenBits;
vis->BlueBits = blueBits;
- vis->AlphaBits = alphaFlag ? (8 * sizeof(GLubyte)) : alphaBits;
+ vis->AlphaBits = alphaBits;
vis->IndexBits = indexBits;
vis->DepthBits = depthBits;
vis->AccumAlphaBits = (accumAlphaBits > 0) ? (8 * sizeof(GLaccum)) : 0;
vis->StencilBits = (stencilBits > 0) ? (8 * sizeof(GLstencil)) : 0;
- vis->SoftwareAlpha = alphaFlag;
-
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.
GLint blueBits,
GLint alphaBits )
{
- return _mesa_create_visual(rgbFlag, alphaFlag, dbFlag, stereoFlag,
+ (void) alphaFlag;
+ return _mesa_create_visual(rgbFlag, dbFlag, stereoFlag,
redBits, greenBits, blueBits, alphaBits,
indexBits, depthBits, stencilBits,
accumBits, accumBits, accumBits, accumBits, 0);