[SDL] Re: Re: Re: Problem with reusing array of surfaces.

John Popplewell john at johnnypops.demon.co.uk
Mon May 12 12:42:01 PDT 2003


Hi,

> ... This happens always if I run the program twice fullscreen. ...

This is starting to sound like a video-card driver problem. What video
card is this? Have you got the latest Win98SE drivers for it?

It isn't unknown for video drivers to leak surface memory ...

> mode there is no problem, in fullscreen 8bit too. It happens only with
> 32bit mode (don't remember about 16bit). If do not use the SDL_HWPALETTE
> in 32bit mode - again there is no problem.

I had a look throught the SDL source and I can't see how SDL_HWPALETTE
can cause a problem. The flags variable in SDL_SetVideoMode() is used
to get a list of modes (but only the fullscreen bit is tested) and if
the chosen mode is greater than 8-bit then SDL_HWPALETTE is *explicitly
cleared* before anything else happens.

cheers,
John.


----- Original Message ----- 
From: "Hri" <hr_hristov at hotmail.com>
To: <sdl at libsdl.org>
Sent: Monday, May 12, 2003 4:17 PM
Subject: [SDL] Re: Re: Re: Problem with reusing array of surfaces.


> Hi, John,
> 
> you are so responsive! Thank you!
> 
> > when you say WinNT, do you mean NT3/4 or are you including Win2K and
> XP?
> >
> > Win2K, XP, 9X, and ME use the DirectX drivers by default.
> > NT3/4 use the WinDIB drivers by default.
> 
> I have tested this code on Win2K SP2, WinXP and Win98 SE.
> 
> > A common problem is that the transparent colour on a surface is
> different
> > after an SDL_DisplayFormat() call, and I am not certain that a surface
> > created by SDL_DisplayFormat() retains accurate colorkey information.
> >
> > Have you tried mapping and setting the colour key on the surface
> created
> > by SDL_DisplayFormat() rather than on the surface you load and then
> > convert? In other word, setting the colourkey, as a last act, on the
> > surface returned by LoadIMG().
> 
> Not yet. I'll try it.
> 
> I have found that there is no colorkey problem under Win98 SE
> if I use 8bit mode and it appears only when the program is fullscreen.
> This happens always if I run the program twice fullscreen. In window
> mode there is no problem, in fullscreen 8bit too. It happens only with
> 32bit mode (don't remember about 16bit). If do not use the SDL_HWPALETTE
> in 32bit mode - again there is no problem.
> Well, perhaps I should avoid using SDL_HWPALETTE in hi-color modes. I
> think that SDL_HWPALETTE makes sense only in paletted 8bit modes and
> eventually this is undetermined behavior.
> Once again this is a problem with Win98 SE only and not with WinNT 5.0+.
> 
> I've just wanted to know why I get these results. I'm trying to avoid
> the "I-have-almost-understood-it" way of doing things ;) which is soo...
> easier and soo... stupid and I'm so addicted to it.
> 
> > I suspect that SDL_HWPALETTE is ignored unless a paletted video mode
> > is in use.
> 
> ...or it causes a problem with Win98 ;) What bothers me if there is a
> problem with WinNT 5.0+ (or maybe even Linux and other OSs) too that is
> not obvious and could appear later. Or simply certain flags are
> incompatible but this is not documented feature (or at least I cannot
> find it yet).
> 
> Until then I'll have to avoid using SDL_HWPALETTE or maybe it is a
> better idea to write a function that sets video mode with the best
> flags.
> 
> Thanks again!
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> _______________________________________________
> SDL mailing list
> SDL at libsdl.org
> http://www.libsdl.org/mailman/listinfo/sdl




More information about the SDL mailing list