diff options
author | Brian Paul <[email protected]> | 2005-05-04 20:11:35 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2005-05-04 20:11:35 +0000 |
commit | e4b2356c07d31fbeeabb13b2fb47db703b473080 (patch) | |
tree | d8b7f1c7c9e7c84d84349485f942dd205dd4c16d /src/mesa/drivers/dri/i810/i810screen.c | |
parent | ebef61f5c0950572f9c6a81b08f447957461675c (diff) |
Major check-in of changes for GL_EXT_framebuffer_object extension.
Main driver impacts:
- new code for creating the Mesa GLframebuffer
- new span/pixel read/write code
Some drivers not yet updated/tested.
Diffstat (limited to 'src/mesa/drivers/dri/i810/i810screen.c')
-rw-r--r-- | src/mesa/drivers/dri/i810/i810screen.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i810/i810screen.c b/src/mesa/drivers/dri/i810/i810screen.c index 072bcd0318e..f270df66b65 100644 --- a/src/mesa/drivers/dri/i810/i810screen.c +++ b/src/mesa/drivers/dri/i810/i810screen.c @@ -36,7 +36,10 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "glheader.h" #include "imports.h" #include "context.h" +#include "framebuffer.h" +#include "fbobject.h" #include "matrix.h" +#include "renderbuffer.h" #include "simple_list.h" #include "utils.h" @@ -330,22 +333,64 @@ i810DestroyScreen(__DRIscreenPrivate *sPriv) } +/** + * Create a buffer which corresponds to the window. + */ static GLboolean i810CreateBuffer( __DRIscreenPrivate *driScrnPriv, __DRIdrawablePrivate *driDrawPriv, const __GLcontextModes *mesaVis, GLboolean isPixmap ) { + i810ScreenPrivate *screen = (i810ScreenPrivate *) driScrnPriv->private; + if (isPixmap) { return GL_FALSE; /* not implemented */ } else { +#if 0 driDrawPriv->driverPrivate = (void *) _mesa_create_framebuffer(mesaVis, GL_FALSE, /* software depth buffer? */ mesaVis->stencilBits > 0, mesaVis->accumRedBits > 0, GL_FALSE /* s/w alpha planes */); +#else + struct gl_framebuffer *fb = _mesa_create_framebuffer(mesaVis); + + { + driRenderbuffer *frontRb + = driNewRenderbuffer(GL_RGBA, screen->cpp, + /*screen->frontOffset*/0, screen->backPitch); + i810SetSpanFunctions(frontRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &frontRb->Base); + } + + if (mesaVis->doubleBufferMode) { + driRenderbuffer *backRb + = driNewRenderbuffer(GL_RGBA, screen->cpp, + screen->backOffset, screen->backPitch); + i810SetSpanFunctions(backRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &backRb->Base); + } + + if (mesaVis->depthBits == 16) { + driRenderbuffer *depthRb + = driNewRenderbuffer(GL_DEPTH_COMPONENT16, screen->cpp, + screen->depthOffset, screen->backPitch); + i810SetSpanFunctions(depthRb, mesaVis); + _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base); + } + + _mesa_add_soft_renderbuffers(fb, + GL_FALSE, /* color */ + GL_FALSE, /* depth */ + mesaVis->stencilBits > 0, + mesaVis->accumRedBits > 0, + GL_FALSE, /* alpha */ + GL_FALSE /* aux */); + driDrawPriv->driverPrivate = (void *) fb; +#endif return (driDrawPriv->driverPrivate != NULL); } } |