From e9e98405e720845f06f7a375585491e938f4dacd Mon Sep 17 00:00:00 2001 From: Daniel Borca Date: Fri, 19 Dec 2003 11:26:46 +0000 Subject: DMesa: removed MGA2064W driver DMesa: added capability to query visuals fxMesa: WGL_3DFX_gamma_control fxMesa: minor fixes to interface (fxQueryHardware vs fxMesaSelect...) --- src/mesa/drivers/glide/fxapi.c | 68 ++++++++++++++++++++---------------------- 1 file changed, 33 insertions(+), 35 deletions(-) (limited to 'src/mesa/drivers/glide/fxapi.c') diff --git a/src/mesa/drivers/glide/fxapi.c b/src/mesa/drivers/glide/fxapi.c index e928b156eb..12b919b2e6 100644 --- a/src/mesa/drivers/glide/fxapi.c +++ b/src/mesa/drivers/glide/fxapi.c @@ -101,20 +101,47 @@ cleangraphics_handler(int s) #endif +/* + * Query 3Dfx hardware presence/kind + */ +static GLboolean GLAPIENTRY fxQueryHardware (void) +{ + if (TDFX_DEBUG & VERBOSE_DRIVER) { + fprintf(stderr, "fxQueryHardware()\n"); + } + + if (!glbGlideInitialized) { + grGlideInit(); + glb3DfxPresent = FX_grSstQueryHardware(&glbHWConfig); + + glbGlideInitialized = 1; + +#if defined(__WIN32__) + _onexit((_onexit_t) cleangraphics); +#elif defined(__linux__) + /* Only register handler if environment variable is not defined. */ + if (!getenv("MESA_FX_NO_SIGNALS")) { + atexit(cleangraphics); + } +#endif + } + + return glb3DfxPresent; +} + + /* * Select the Voodoo board to use when creating * a new context. */ -GLboolean GLAPIENTRY fxMesaSelectCurrentBoard (int n) +GLint GLAPIENTRY fxMesaSelectCurrentBoard (int n) { fxQueryHardware(); if ((n < 0) || (n >= glbHWConfig.num_sst)) - return GL_FALSE; - - glbCurrentBoard = n; + return -1; - return GL_TRUE; + return glbHWConfig.SSTs[glbCurrentBoard = n].type; } @@ -415,7 +442,7 @@ fxMesaCreateContext(GLuint win, redBits = 5; greenBits = 5; blueBits = 5; - alphaBits = 1; + alphaBits = depthSize ? 1 : 8; switch(fxMesa->fsaa) { case 8: pixFmt = GR_PIXFMT_AA_8_ARGB_1555; @@ -851,35 +878,6 @@ fxMesaSwapBuffers(void) } -/* - * Query 3Dfx hardware presence/kind - */ -GLboolean GLAPIENTRY fxQueryHardware (void) -{ - if (TDFX_DEBUG & VERBOSE_DRIVER) { - fprintf(stderr, "fxQueryHardware()\n"); - } - - if (!glbGlideInitialized) { - grGlideInit(); - glb3DfxPresent = FX_grSstQueryHardware(&glbHWConfig); - - glbGlideInitialized = 1; - -#if defined(__WIN32__) - _onexit((_onexit_t) cleangraphics); -#elif defined(__linux__) - /* Only register handler if environment variable is not defined. */ - if (!getenv("MESA_FX_NO_SIGNALS")) { - atexit(cleangraphics); - } -#endif - } - - return glb3DfxPresent; -} - - /* * Shutdown Glide library */ -- cgit v1.2.3