Max size of an SDL_Surface

Started by
4 comments, last by Feidias 18 years, 8 months ago
I was just wondering if anyone knows or knows where to find the max resolution of an SDL_Surface with 32 bits per a pixel?
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.
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.
I like the DARK layout!
Can't you just try it out yourself? Try 2000*2000, and if it works 3000*3000 etc. til it doesnt work anymore :D

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).
{[JohnE, Chief Architect and Senior Programmer, Twilight Dragon Media{[+++{GCC/MinGW}+++{Code::Blocks IDE}+++{wxWidgets Cross-Platform Native UI Framework}+++
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.

This topic is closed to new replies.

Advertisement