From fa21787b52d85a7aeaf5de64a39e019f39fcfa07 Mon Sep 17 00:00:00 2001 From: Daniel Borca Date: Tue, 2 Mar 2004 08:15:24 +0000 Subject: workaround for crash-upon-exit in verbose mode fxMesa now uses grQueryResolution minor fixes to X11 and DOS drivers --- src/mesa/drivers/x11/xm_api.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'src/mesa/drivers/x11/xm_api.c') diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c index 16963ab71c..c36c9c9c6a 100644 --- a/src/mesa/drivers/x11/xm_api.c +++ b/src/mesa/drivers/x11/xm_api.c @@ -1830,15 +1830,19 @@ XMesaBuffer XMesaCreateWindowBuffer2( XMesaVisual v, XMesaWindow w, } attribs[numAttribs++] = FXMESA_NONE; - /* [dBorca] we should take an envvar for `fxMesaSelectCurrentBoard'!!! */ - if ((hw = fxMesaSelectCurrentBoard(0))==GR_SSTTYPE_VOODOO) { + /* [dBorca] we should take an envvar for `fxMesaSelectCurrentBoard'!!! */ + hw = fxMesaSelectCurrentBoard(0); + if ((hw == GR_SSTTYPE_VOODOO) || (hw == GR_SSTTYPE_Voodoo2)) { b->FXctx = fxMesaCreateBestContext(0, b->width, b->height, attribs); if ((v->undithered_pf!=PF_Index) && (b->backimage)) { b->FXisHackUsable = b->FXctx ? GL_TRUE : GL_FALSE; - if (fxEnvVar[0]=='w' || fxEnvVar[0]=='W') - b->FXwindowHack = b->FXctx ? GL_TRUE : GL_FALSE; - else + if (b->FXctx && (fxEnvVar[0]=='w' || fxEnvVar[0]=='W')) { + b->FXwindowHack = GL_TRUE; + FX_grSstControl(GR_CONTROL_DEACTIVATE); + } + else { b->FXwindowHack = GL_FALSE; + } } } else { @@ -2210,6 +2214,10 @@ GLboolean XMesaSetFXmode( GLint mode ) return GL_FALSE; } if (ctx) { + /* [dBorca] Hack alert: + * oh, this is sooo wrong: ctx above is + * really an fxMesaContext, not an XMesaContext + */ XMesaContext xmesa = XMESA_CONTEXT(ctx); if (mode == XMESA_FX_WINDOW) { if (xmesa->xm_draw_buffer->FXisHackUsable) { @@ -2269,10 +2277,7 @@ static void FXgetImage( XMesaBuffer b ) xmesa_alloc_back_buffer( b ); } - /* [dBorca] - * not needed for Voodoo2 anymore. - * should we test fxMesa->bgrOrder? - */ + /* [dBorca] we're always in the right GR_COLORFORMAT... aren't we? */ /* grLfbWriteColorFormat(GR_COLORFORMAT_ARGB); */ if (b->xm_visual->undithered_pf==PF_5R6G5B) { /* Special case: 16bpp RGB */ -- cgit v1.2.3