Jump to content
  • Advertisement
Sign in to follow this  
destiny_breaker86

Max size of an SDL_Surface

This topic is 4847 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

Advertisement
There was a topic about this on this forum if I remember correctly, do a search. As far as I know, a surface can be as big as your memory can hold.

Share this post


Link to post
Share on other sites
As SDL is implemented on top of who knows what (DirectX, X, etc), it could be pretty much anything. For instance, I've got an old computer around here that doesn't allow DirectDraw to create surfaces wider than the current video mode (but these days you probably wouldn't have to worry about that). I don't think there's any way to ask SDL to find out for you.

Share this post


Link to post
Share on other sites
Can't you just try it out yourself? Try 2000*2000, and if it works 3000*3000 etc. til it doesnt work anymore :D

Share this post


Link to post
Share on other sites
Quote:
Original post by Toadhead
Can't you just try it out yourself? Try 2000*2000, and if it works 3000*3000 etc. til it doesnt work anymore :D


Har har.

My idea would be a simple calculation. The SDL_VideoInfo structure returned by SDL_GetVideoInfo() has a video_mem value, holding the size of video memory. AFAIK, SDL doesn't have a way of finding out the maximum allocable memory by your program, and I don't know it OTTOMH, but once you have those two you can find the maximum size for a hardware surface and for a software surface (32 bits per pixel, 4 bytes per pixel, work your way up from there).

Share this post


Link to post
Share on other sites
To find out if the video mode (=resolution) is supported use SDL_VideoModeOK. If you are talking about SDL_Surface (other than main video surface which is obtained from SDL_SetVideoMode) then there is no other limit than memory, I think. For example I have created a surface of size 24 x 5520.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!