Epicenter posted on Feb 12 2006 at 09:45 PM said:
Partaining to the 5MB hardware surface limit-- in what format are these surfaces? e.g. if I were to want to use a 20kb PNG file as a hardware surface-- should I assume it's going to be converted into a very large bitmap-like format and stored in VRAM? If so, I imagine I won't be able to fit very much there-- and storing anything like a big, long scrolling background is going to be totally out of the question. I'd have to just put smaller things like character and bullet/effect sprites there.
What happens to surfaces past that 5MB Limit-- are they stored in main system RAM and used as software surfaces on their own or do I need to allocate these resources carefully, defining hardware surfaces separately from software ones to avoid exceeding that limit? Are you allowing for the use of up to 8MB (incl. the VRAM normally used for overlays) just yet or is that planned for in the future?
Also, are SDL_GFX functions like rotozoom yet supported? Sorry for all the questions. Thanks.
It's raw bitmap data held in either 8bpp or 16bpp depending on what you request the video mode to be in.
Once you've used up the memory any attempt to allocate HWSURFACEs will fail and you'll have to either free some surfaces or allocate them as SWSURFACEs. At some point I'll add a function to reorganize HWSURFACEs so that after you've freed some it'll move all the free space to the end.
The next 3MB after the 5 I've taken is used for 3x 1MB video surfaces so I should be able to extend into there. I'm not sure what area of memory is taken for the audio buffers at the moment. The main problem is that this upper 32MB isn't managed by Linux, the drivers all use there own hard-coded memory regions.
I'll allocate more of the upper memory as I can when I find out what areas are (relatively) safe to trash.
Rotozoom does software rotation/zooming of one surface to another doesn't it? As long as it's in C(++) it should work without any problems.