From 4d5e6623d36183b9c0380aa5da8fa37a979ce441 Mon Sep 17 00:00:00 2001 From: Daniel Borca Date: Thu, 15 Jan 2004 07:16:06 +0000 Subject: _mesa_delete_texture_object and some other updates --- src/mesa/drivers/dos/dmesa.c | 9 +++++++++ src/mesa/drivers/glide/fxapi.c | 2 ++ src/mesa/drivers/glide/fxddtex.c | 4 ++++ src/mesa/drivers/glide/fxsetup.c | 2 +- src/mesa/drivers/glide/fxwgl.c | 14 +++++--------- 5 files changed, 21 insertions(+), 10 deletions(-) (limited to 'src/mesa/drivers') diff --git a/src/mesa/drivers/dos/dmesa.c b/src/mesa/drivers/dos/dmesa.c index 2eb260ff30..33c17c144e 100644 --- a/src/mesa/drivers/dos/dmesa.c +++ b/src/mesa/drivers/dos/dmesa.c @@ -1115,6 +1115,15 @@ DMesaVisual DMesaCreateVisual (GLint width, freopen("MESA.LOG", "w", stderr); } + if (((env = getenv("FX_GLIDE_REFRESH")) == NULL) || !atoi(env)) { + /* FX_GLIDE_REFRESH=0 has a special meaning for DJGPP Glide3x + * (switch via VESA, using default refresh) and we'll not override that. + */ + char tmp[256]; + sprintf(tmp, "FX_GLIDE_REFRESH=%u", refresh); + putenv(tmp); + } + return (DMesaVisual)fxMesaCreateBestContext(-1, width, height, fx_attrib); #endif /* FX */ } diff --git a/src/mesa/drivers/glide/fxapi.c b/src/mesa/drivers/glide/fxapi.c index c1dea541e2..6ed9453c9b 100644 --- a/src/mesa/drivers/glide/fxapi.c +++ b/src/mesa/drivers/glide/fxapi.c @@ -203,8 +203,10 @@ gl3DfxSetPaletteEXT(GLuint * pal) static GrScreenResolution_t fxBestResolution (int width, int height) { static int resolutions[][5] = { +#if 1 /* Voodoo^2 can't fullscreen these, because of Glide */ { 320, 200, GR_RESOLUTION_320x200 }, { 320, 240, GR_RESOLUTION_320x240 }, +#endif { 512, 384, GR_RESOLUTION_512x384 }, { 640, 400, GR_RESOLUTION_640x400 }, { 640, 480, GR_RESOLUTION_640x480 }, diff --git a/src/mesa/drivers/glide/fxddtex.c b/src/mesa/drivers/glide/fxddtex.c index 629f0e311e..eaca8401b8 100644 --- a/src/mesa/drivers/glide/fxddtex.c +++ b/src/mesa/drivers/glide/fxddtex.c @@ -43,6 +43,7 @@ #include "image.h" #include "teximage.h" #include "texformat.h" +#include "texobj.h" #include "texstore.h" #include "texutil.h" @@ -365,6 +366,9 @@ fxDDTexDel(GLcontext * ctx, struct gl_texture_object *tObj) FREE(ti); tObj->DriverData = NULL; + + /* Free mipmap images and the texture object itself */ + _mesa_delete_texture_object(ctx, tObj); } /* diff --git a/src/mesa/drivers/glide/fxsetup.c b/src/mesa/drivers/glide/fxsetup.c index 61ceb6e7ac..17a4129eb6 100644 --- a/src/mesa/drivers/glide/fxsetup.c +++ b/src/mesa/drivers/glide/fxsetup.c @@ -80,7 +80,7 @@ fxTexValidate(GLcontext * ctx, struct gl_texture_object *tObj) * than hardware can support. Two cases: * 1) we have mipmaps. Then we just push up to the first supported * LOD. A possible drawback is that Mesa will ignore the skipped - * LODs on further texture handling (including memory freeing). + * LODs on further texture handling. * Will this interfere with GL_TEXTURE_[MIN|BASE]_LEVEL? How? * 2) we don't have mipmaps. We need to rescale texture; two ways: * a) create a new LOD and push up ti->minLevel and tObj->BaseLevel diff --git a/src/mesa/drivers/glide/fxwgl.c b/src/mesa/drivers/glide/fxwgl.c index 7b323dd617..adf88a485c 100644 --- a/src/mesa/drivers/glide/fxwgl.c +++ b/src/mesa/drivers/glide/fxwgl.c @@ -324,18 +324,14 @@ wglCreateContext(HDC hdc) SetWindowLong(hWnd, GWL_WNDPROC, (LONG) __wglMonitor); } -#if FX_DEBUG - /* always log when debugging */ - freopen("MESA.LOG", "w", stderr); -#else - /* log only if user wants */ { - char *env = getenv("MESA_FX_INFO"); - if (env && env[0] == 'r') { + char *env; + /* always log when debugging, or if user demands */ +#if !FX_DEBUG + if ((env = getenv("MESA_FX_INFO")) && env[0] == 'r') +#endif freopen("MESA.LOG", "w", stderr); - } } -#endif { RECT cliRect; -- cgit v1.2.3