_mesa_delete_texture_object and some other updates

This commit is contained in:
Daniel Borca 2004-01-15 07:16:06 +00:00
parent 3663c0f825
commit 4d5e6623d3
5 changed files with 22 additions and 11 deletions

View file

@ -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 */
}

View file

@ -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 },

View file

@ -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);
}
/*

View file

@ -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

View file

@ -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') {
freopen("MESA.LOG", "w", stderr);
}
}
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);
}
{
RECT cliRect;