depth_bits_array[0] = depth_bits;
depth_bits_array[1] = depth_bits;
-
+
/* Just like with the accumulation buffer, always provide some modes
* with a stencil buffer. It will be a sw fallback, but some apps won't
* care about that.
const GLboolean swAccum = mesaVis->accumRedBits > 0;
const GLboolean swStencil = mesaVis->stencilBits > 0 &&
mesaVis->depthBits != 24;
-#if 0
- driDrawPriv->driverPrivate = (void *)
- _mesa_create_framebuffer( mesaVis,
- swDepth,
- swStencil,
- swAccum,
- swAlpha );
-#else
struct gl_framebuffer *fb = _mesa_create_framebuffer(mesaVis);
+ /* front color renderbuffer */
{
driRenderbuffer *frontRb
= driNewRenderbuffer(GL_RGBA, screen->cpp,
_mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &frontRb->Base);
}
+ /* back color renderbuffer */
if (mesaVis->doubleBufferMode) {
driRenderbuffer *backRb
= driNewRenderbuffer(GL_RGBA, screen->cpp,
_mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &backRb->Base);
}
+ /* depth renderbuffer */
if (mesaVis->depthBits == 16) {
driRenderbuffer *depthRb
= driNewRenderbuffer(GL_DEPTH_COMPONENT16, screen->cpp,
screen->depthOffset, screen->depthPitch);
r200SetSpanFunctions(depthRb, mesaVis);
_mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
+ depthRb->depthHasSurface = screen->depthHasSurface;
}
else if (mesaVis->depthBits == 24) {
driRenderbuffer *depthRb
screen->depthOffset, screen->depthPitch);
r200SetSpanFunctions(depthRb, mesaVis);
_mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
+ depthRb->depthHasSurface = screen->depthHasSurface;
}
+ /* stencil renderbuffer */
if (mesaVis->stencilBits > 0 && !swStencil) {
driRenderbuffer *stencilRb
= driNewRenderbuffer(GL_STENCIL_INDEX8_EXT, screen->cpp,
swAlpha,
GL_FALSE /* aux */);
driDrawPriv->driverPrivate = (void *) fb;
-#endif
+
return (driDrawPriv->driverPrivate != NULL);
}
}