[SDL] SDL_image and memory

benang at cs.its.ac.id benang at cs.its.ac.id
Wed Sep 20 03:40:48 PDT 2006

Okay, now I get the big picture. Anyway, the bitmaps were overwhelming and
made the application crash. So, I intend to do it in the SDL_image's way.
One more question though, is there any library for playing avi or mpg
files with SDL?

Thanks alot.

> On Wednesday 20 September 2006 06:15, benang at cs.its.ac.id wrote:
>> Thanks for the reply. Okay what if I change my question. If I load
>> the resources into RWops pointers, and convert them to SDL_Surface
>> only when needed, would the cost of conversion be more efficient
>> than if the SDL_Surface were all (or partially) be read from the
>> swap pagefile (obviously it will happen because the total of the
>> bitmap files are 6-700 megs whereas my memory is only 512 megs)?
> As far as performance is concerned, that depends on the speed of the
> disk the swap is on, in relation to the speed of the CPU. Also, if
> your application already needs a lot of CPU time, adding
> decompression overhead might be worse than streaming from disk, even
> if the disk is relatively slow.
> There is another problem, however: Timing. Disk access is rather
> "random" in nature; sometimes it's very quick (data already cached or
> in the read-ahead buffers), and sometimes very slow (data needs to be
> read from the physical disk before your application can continue). To
> keep the disk access from making animation unsmooth, you'd need to do
> the disk access in a background thread or similar.
> //David Olofson - Programmer, Composer, Open Source Advocate

More information about the SDL mailing list