Fullscreen woes and troubles SOLVED
I am having problems with my code. I am learning the basics of sdl in order to create a tetris clone.. When I run the code so far in windowed mode it works correctly. Shows my images in theyr places and all is good. But when I switch to fulscreen I get a black screen and a mouse cursor.. nothing more.. Anyone know what is going on?
Within these links you find my code files :
http://muer.njoerdba.com/paste/view.aspx?id=33863e91-e8dc-4ef0-a627-b0e19934e23a
http://muer.njoerdba.com/paste/view.aspx?id=0f1e82b7-36f7-4e2e-bb83-1e1195fdc822
http://muer.njoerdba.com/paste/view.aspx?id=c19b9466-85a4-4404-86e7-c8c3b054ca52
http://muer.njoerdba.com/paste/view.aspx?id=3cedfbb7-bcb1-4244-aa17-990c0008ffb8
If anyone would like to take a look I´ll be gratefull :)
[Edited by - Talmir on July 28, 2005 5:45:38 PM]
Links clickified for lazy people:
main
includes
gamestate
bitmaps
Did you switch to fullscreen when the program started or in the middle of it after you already showed all the bitmaps?
main
includes
gamestate
bitmaps
Did you switch to fullscreen when the program started or in the middle of it after you already showed all the bitmaps?
The fullscreen change is the first thing that happens. Since it is the first instruction the game runs.
like so:
Screen = SDL_SetVideoMode(640, 480, 16, SDL_HWSURFACE | SDL_DOUBLEBUF | SDL_FULLSCREEN);
like so:
Screen = SDL_SetVideoMode(640, 480, 16, SDL_HWSURFACE | SDL_DOUBLEBUF | SDL_FULLSCREEN);
I really don't know much about SDL because I only played around with it once to make a small game but eventually gave up because of lack of time.
Hopefully someone else can solve this because I can only show you what I did and this line worked for me but it's not much different from what you do.
The only thing I did different was to use SDL_ANYFORMAT but I'm completely unsure if that might work. I have just read about SDL_ANYFORMAT and I think it doesn't have anything to do with your problem...
SDL_ANYFORMAT
Normally, if a video surface of the requested depth (bpp) is not available, SDL
will emulate one with a shadow surface. Passing SDL_ANYFORMAT prevents this and
causes SDL to use the video surface, regardless of its depth.
Hopefully someone else can solve this because I can only show you what I did and this line worked for me but it's not much different from what you do.
if (fullscreen) {screen = SDL_SetVideoMode(resolution.x, resolution.y, resolution.z, SDL_HWSURFACE | SDL_DOUBLEBUF | SDL_FULLSCREEN | SDL_ANYFORMAT );} else screen = SDL_SetVideoMode(resolution.x, resolution.y, resolution.z, SDL_HWSURFACE | SDL_DOUBLEBUF | SDL_ANYFORMAT );
The only thing I did different was to use SDL_ANYFORMAT but I'm completely unsure if that might work. I have just read about SDL_ANYFORMAT and I think it doesn't have anything to do with your problem...
SDL_ANYFORMAT
Normally, if a video surface of the requested depth (bpp) is not available, SDL
will emulate one with a shadow surface. Passing SDL_ANYFORMAT prevents this and
causes SDL to use the video surface, regardless of its depth.
You can query SDL for a set of supported screen resolutions. I usually find I have any resolutions I like in windowed mode, but a set of only 8 or so in fullscreen. If you ask for an unsupported screen resolution I don't actually know what happens.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement