Jump to content
  • Advertisement
Sign in to follow this  
Think128

SDL_Surface Size Limit

This topic is 4714 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!