SDL_Surface Size Limit

Started by
3 comments, last by Think128 18 years, 9 months ago
I read somewhere (I thought it was in the actual SDL docs but apparently I was mistaken) that SDL_Surfaces have size limits. If you assign too much data to them (i.e. load too big of an image) then they sieze up and cause bunches of errors. Is this true? If so what is the limit?
Advertisement
I don't if such a limit exists, but I can happily load a 4.5mb 3900 * 400 BMP and have no issues. :)

Cheers,
I asked a similar question concerning allegro BITMAPs awhile ago. The basic answer I recieved was that if you're going over the size limit, you're probably doing something wrong.
-----------------------------Play Stompy's Revenge! Now!
This was brought up on the SDL mailing list somewhat recently in a thread called [SDL] pre-load frames in memory:

Quote:Btw, note that because SDL 1.x uses 16-bit words for surface width and height, you can't have a surface wider than 16383 pixels, or higher than 65535 pixels. (There's a bug in 1.2.8 that makes the height limit 16383 as well, but Sam's fixed that in CVS).


Those are pretty big numbers - off the top of my head I can't think of any reason you'd need (or want) surfaces that are larger than 16,000 pixels wide or high
Very true and thanks for explaining.

I'm trying to make a 2d side-scroller and instead of tiling I was going to use drawn levels. I wanted to know what kind of limitations I might have to work around.

This topic is closed to new replies.

Advertisement