How do I find out the current screen resolution: you cannot

Aaron: I think the answer to your question is: you can not. :frowning:

I’ve been trying hard to find how ho to get this (supposedly) basic feature.
Unfortunately it seems that SDL designers made yet another design slip here.

You just cannot.

You can query whether the current video system would support
a hypothetical 341x1345 resolution with 13.5 bits per pixels, with hardware blit support
and double buffering, and, only on frames numbered with a prime number, alpha blending;
however the current screen resolution of your system is just a well-kept secret and
SDL will not tell you, not ever, not under torture.

A solution would be simple and straightforward, at least syntactically.

SDL_SetVideoMode( width, height, bpp, flags )

Should behave with its 1st and 2nd parameter in the same way it is doing
now with its 3rd: if set to zero (and fullscreen bit of flags is ON),
current video values should be kept (that’s not how it works).

Let me just underline how important this missing feature is: it is impossible
for our applications to divine the right (or the default) screen resolution.
Especially with LCD monitors, resolutions different than the expected one
result in inferior image quality. With the application blind to the currently used
resolution (as it is now) the final user must either choose the res
within the game, or edit a cfg file: now just how bad is that (compared
to “just run it and it works”)?

Going for the highest resolutions available (that, you can check)
is not a good option either: some video setting -especially on laptops-
allow for “virtual” resolution higher than the actual number of pixel and activate
low level panning to implement it. Of course you don’t want that.

Unfortunately, this and a few other minor “features” of SDL -minor in an implementation
sense, not as for the consequences- are such a disgrace
that I regrettedly have to go back to the old - and otherwise much worse -
GLUT :(((. Which is bad, taking in account what a nice powerful library SDL
would be for writing cross-platform games.

I think the problem is that SDL is not very much openGL oriented after all. If you target
sprite-based games, than it maybe makes sense to impose a resolution independently
from the optimal (or the currently used) one: a resampling will take place anyhow.
However, if you are going for 3D games, resolution is your to choose. Using
the current one is a straightforward, natural, ever-lasting, good option.

I’ll consider doing something for this. I’ll need to find a way to help first.

M.>I’ve been trying without success to change to a fullscreen video mode

MATCHING the current screen resolution. Where can I get this
information through SDL? I know it stores it somewhere because it
remembers what resolution to return to after you quit.
Any way to access it?
There are some functions like GetVideoSurface which seem to make
sense, but you get a null until the video mode is set and then you are
getting SDL’s new window res not the screen res. Thanks, in advance.

Aaron