[SDL] Downsizing resources

Jeremy jswigart at gmail.com
Mon Nov 5 08:44:53 PST 2007


Use texture compression if SDL allows you to. That's the only option other
than downscaling, reducing how much you use, or load on demand, all of which
have downsides and may not be an option depending on what you do.

On 11/5/07, Alberto Luaces <aluaces at udc.es> wrote:
>
> El Monday 05 November 2007 17:18:04 Miguel Pragier escribió:
> > Alberto Luaces <aluaces <at> udc.es> writes:
> > > El Monday 05 November 2007 13:42:52 Miguel Pragier escribió:
> > > > At present, I work on 32 bits PNG images.
> > > >
> > > > The original 32 MB of PNG files, takes 110 MBs RAM, when the game
> > > > runs..
> > > >
> > > > Would anyone know a way to downsize this consume?
> > >
> > > Load only an image when you need it, delete it as soon as you aren't
> > > using it.
> >
> > Ok.
> >
> > In my games I have a lot of bonus ( jackPot-like ) animations.
> > When I load my images just before the use, we experience a small delay.
> > I read something about to shrink images resolution to 24 bits. Is it
> > possible? Can I convert my images from 32 bits to 24 and keep the
> quality?
> > My plattaform is Windows, and the desktop is ~32 bit colors~.
>
> You can develop some more complex strategies, as loading the image for the
> first time and not freeing its memory until you are sure it would not be
> needed for a long time, what one would call a "cache". Maybe you have to
> spend a little bit of memory for the possibly used graphics, but it
> shouldn't
> be necessary to reach that 110 megabyte size. You will have to think about
> the trade off between the loading delay and the amount of RAM used and
> adjust
> the program accordingly.
>
> If your display is 32 bit, you win nothing converting your graphics to 24
> bit,
> as you (or the driver) will eventually have to convert them again to 32
> bit
> at blit time, so you will experience lower performance.
> _______________________________________________
> SDL mailing list
> SDL at lists.libsdl.org
> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20071105/48763621/attachment.html 


More information about the SDL mailing list