diff options
Diffstat (limited to 'src/mesa/drivers/glide/fxapi.c')
-rw-r--r-- | src/mesa/drivers/glide/fxapi.c | 68 |
1 files changed, 33 insertions, 35 deletions
diff --git a/src/mesa/drivers/glide/fxapi.c b/src/mesa/drivers/glide/fxapi.c index e928b156eb5..12b919b2e60 100644 --- a/src/mesa/drivers/glide/fxapi.c +++ b/src/mesa/drivers/glide/fxapi.c @@ -102,19 +102,46 @@ cleangraphics_handler(int s) /* + * 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; @@ -852,35 +879,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 */ void GLAPIENTRY |