xmesa_init_driver_functions(v, &functions);
st_init_driver_functions(&functions);
- /* override st's function */
- functions.UpdateState = xmesa_update_state;
-
- /*
- functions.NewRenderbuffer = xmesa_new_renderbuffer;
- */
-
if (!_mesa_initialize_context(mesaCtx, &v->mesa_visual,
share_list ? &(share_list->mesa) : (GLcontext *) NULL,
&functions, (void *) c)) {
}
-#if 0
-struct gl_renderbuffer *
-xmesa_new_renderbuffer(GLcontext *ctx, struct gl_renderbuffer *rb,
- GLenum internalFormat, GLuint width, GLuint height)
-{
- struct xmesa_renderbuffer *xrb = CALLOC_STRUCT(xmesa_renderbuffer);
- if (xrb) {
- GLuint name = 0;
- _mesa_init_renderbuffer(&xrb->St.Base, name);
-
- xrb->St.Base.Delete = xmesa_delete_renderbuffer;
- if (backBuffer)
- xrb->St.Base.AllocStorage = xmesa_alloc_back_storage;
- else
- xrb->St.Base.AllocStorage = xmesa_alloc_front_storage;
-
- if (visual->rgbMode) {
- xrb->St.Base.InternalFormat = GL_RGBA;
- xrb->St.Base._BaseFormat = GL_RGBA;
- xrb->St.Base.DataType = GL_UNSIGNED_BYTE;
- xrb->St.Base.RedBits = visual->redBits;
- xrb->St.Base.GreenBits = visual->greenBits;
- xrb->St.Base.BlueBits = visual->blueBits;
- xrb->St.Base.AlphaBits = visual->alphaBits;
- }
- else {
- xrb->St.Base.InternalFormat = GL_COLOR_INDEX;
- xrb->St.Base._BaseFormat = GL_COLOR_INDEX;
- xrb->St.Base.DataType = GL_UNSIGNED_INT;
- xrb->St.Base.IndexBits = visual->indexBits;
- }
- /* only need to set Red/Green/EtcBits fields for user-created RBs */
- }
- return xrb;
-}
-#endif
-
-
/**
* Called via gl_framebuffer::Delete() method when this buffer
* is _really_ being deleted.
}
-/**
- * Called when the driver should update its state, based on the new_state
- * flags.
- */
-void
-xmesa_update_state( GLcontext *ctx, GLbitfield new_state )
-{
-#if 0
- const XMesaContext xmesa = XMESA_CONTEXT(ctx);
-#endif
-
- st_invalidate_state( ctx, new_state );
-
-
- if (ctx->DrawBuffer->Name != 0)
- return;
-
- /*
- * GL_DITHER, GL_READ/DRAW_BUFFER, buffer binding state, etc. effect
- * renderbuffer span/clear funcs.
- */
- if (new_state & (_NEW_COLOR | _NEW_BUFFERS)) {
- XMesaBuffer xmbuf = XMESA_BUFFER(ctx->DrawBuffer);
- struct xmesa_renderbuffer *front_xrb, *back_xrb;
-
- front_xrb = xmbuf->frontxrb;
- if (front_xrb) {
-#if 0
- xmesa_set_renderbuffer_funcs(front_xrb, xmesa->pixelformat,
- xmesa->xm_visual->BitsPerPixel);
- front_xrb->clearFunc = clear_pixmap;
-#endif
- }
-
- back_xrb = xmbuf->backxrb;
- if (back_xrb) {
-#if 0
- xmesa_set_renderbuffer_funcs(back_xrb, xmesa->pixelformat,
- xmesa->xm_visual->BitsPerPixel);
- if (xmbuf->backxrb->pixmap) {
- back_xrb->clearFunc = clear_pixmap;
- }
- else {
- switch (xmesa->xm_visual->BitsPerPixel) {
- case 8:
- back_xrb->clearFunc = clear_8bit_ximage;
- break;
- case 16:
- back_xrb->clearFunc = clear_16bit_ximage;
- break;
- case 24:
- back_xrb->clearFunc = clear_24bit_ximage;
- break;
- case 32:
- back_xrb->clearFunc = clear_32bit_ximage;
- break;
- default:
- back_xrb->clearFunc = clear_nbit_ximage;
- break;
- }
- }
-#endif
- }
- }
-}
-
-
-
/**
* Called by glViewport.
* This is a good time for us to poll the current X window size and adjust
xmesa_init_driver_functions( XMesaVisual xmvisual,
struct dd_function_table *driver )
{
- driver->UpdateState = xmesa_update_state;
driver->Flush = finish_or_flush;
driver->Finish = finish_or_flush;
driver->Viewport = xmesa_viewport;
}
break;
default:
- _mesa_problem(NULL, "Bad pixel format in xmesa_update_state (1)");
+ _mesa_problem(NULL, "Bad pixel format in xmesa_set_renderbuffer_funcs");
return;
}
xmesa_init_driver_functions( XMesaVisual xmvisual,
struct dd_function_table *driver );
-extern void
-xmesa_update_state( GLcontext *ctx, GLbitfield new_state );
-
extern void
xmesa_set_renderbuffer_funcs(struct xmesa_renderbuffer *xrb,
enum pixel_format pixelformat, GLint depth);