Jump to content
  • Advertisement
Sign in to follow this  
Talmir

Fullscreen woes and troubles SOLVED

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

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]

Share this post


Link to post
Share on other sites
Advertisement
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);

Share this post


Link to post
Share on other sites
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.


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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
My problem lay in the locking of surfaces.. the code was faulty :P Thanks for your help everyone :)

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!