sdl fullscreen problem

Started by
4 comments, last by kuroi 14 years, 1 month ago
i'm having some trouble with working at fullscreen. this is the code:

#define SCREEN_WIDTH  640
#define SCREEN_HEIGHT 480
#define SCREEN_BPP     32

bool fullscreen = false;

void MudaVideo(int t)
{
    fullscreen = (t == SDL_FULLSCREEN);
    screen = SDL_SetVideoMode(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_BPP, t);
}
to change the video i just call it this way:

    MudaVideo(SDL_FULLSCREEN);
or

    MudaVideo(SDL_SWSURFACE);                    
this seems to work fine on the computer i'm working. the problem is, when i take the project to another computer, the fullscreen doesn't work. i mean, it really turns into full screen, but the screen is not streched. when working on the window mode, my game occupies a region of 480 X 640 pixels. when i turn to fullscreen on the computer i'm working, the region is streched, the images are zoomed, and occupy the full monitor. but i tried to take it to two other different pcs, and it happens that when i turn to fullscreen, the image does not strech, it remains occupying a region of 480 X 640 pixels, and is surrounded by black. what could it be?? is this common?? this is sdl for windows compiled on dev c++. thanks.
Advertisement
In my experience this happens when you aren't using a native resolution that the monitor supports. It then will display the screen in the resolution specified with the black border around the screen since it cannot scale the resolution properly.

This usually happens with LCD monitors since CRTs are able to scale easier.

So my advice would be to check if the resolution you have specified is supported by the monitor you are using.
Signal is correct, the monitor must not support such a low resolution. You could try 800x600 which is much more likely to be a supported resolution.
thanks, signal, simian man.
right now, i don't have access to other computer besides mine, so i can't test anything. but soon, i shall try it again on 800x600 at the other two computers i mentioned (one of them is crt, the other lcd) and if i have som problem, i'll post here again.
I tried to see if there was a way to see what video modes your program would have access to. That is, list all supported resolutions. I believe it can. Read this.

C++: A Dialog | C++0x Features: Part1 (lambdas, auto, static_assert) , Part 2 (rvalue references) , Part 3 (decltype) | Write Games | Fix Your Timestep!

very good, nobobynews, thanks for that.

This topic is closed to new replies.

Advertisement