Sdl newbie question

Hello all.

This is my first post to the sdl-list.

I have made a basic program that setup a window and draws some objects
(C++/Windows2000), and I must say SDL is great!

All works fine, including fullscreen.

However if I quit the application while in fullscreen mode, the
resolution i set in SDL will remain.
So if I have a 1280x1024 desktop, I have a 800x600 desktop after running
my app.

If anyone has a way of getting around this I’d be very gratefull. I
suppose one could set the mode before quitting? But how do I know what
videomode people ran in the first place - I haven’t found a
’SDL_GetVideoMode()’?

best regards,

Martin Kr?is

ps.

http://www.libsdl.org/pipermail/sdl/

says year 2024… :slight_smile:

Quoting martin krois :

Hello all.

This is my first post to the sdl-list.

I have made a basic program that setup a window and draws some objects
(C++/Windows2000), and I must say SDL is great!

All works fine, including fullscreen.

However if I quit the application while in fullscreen mode, the
resolution i set in SDL will remain.
So if I have a 1280x1024 desktop, I have a 800x600 desktop after
running
my app.

If anyone has a way of getting around this I’d be very gratefull. I
suppose one could set the mode before quitting? But how do I know what
videomode people ran in the first place - I haven’t found a
’SDL_GetVideoMode()’?

best regards,

Martin Kr?is

ps.

http://www.libsdl.org/pipermail/sdl/

says year 2024… :slight_smile:


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

I have never encountered this problem, but are you remembering to call SDL_Quit()?

/Gorm

gorm at lai.as wrote:

Quoting martin krois <@martin_krois>:

However if I quit the application while in fullscreen mode, the
resolution i set in SDL will remain.
So if I have a 1280x1024 desktop, I have a 800x600 desktop after
running
my app.

I have never encountered this problem, but are you remembering to call SDL_Quit()?

yes :\

/martin

Sounds like what happens if your application crashes before it gets a
chance to close it’s window properly… It’s very common on Windows, but
I’ve seen it on X as well. It’s not SDL specific; on the contrary, the
SDL parachute seems to avoid the problem most of the time.

//David Olofson — Programmer, Reologica Instruments AB

.- M A I A -------------------------------------------------.
| Multimedia Application Integration Architecture |
| A Free/Open Source Plugin API for Professional Multimedia |
----------------------------> http://www.linuxdj.com/maia -' .- David Olofson -------------------------------------------. | Audio Hacker - Open Source Advocate - Singer - Songwriter |--------------------------------------> david at linuxdj.com -'On Thursday 23 August 2001 15:30, martin krois wrote:

Hello all.

This is my first post to the sdl-list.

I have made a basic program that setup a window and draws some objects
(C++/Windows2000), and I must say SDL is great!

All works fine, including fullscreen.

However if I quit the application while in fullscreen mode, the
resolution i set in SDL will remain.
So if I have a 1280x1024 desktop, I have a 800x600 desktop after
running my app.

Hello,

I had this problem, and in my case it was because
SDL_Quit wasn’t being called - I believe SDL_Quit will
reset the resolution to the way it was. An
atexit(SDL_Quit) should work (though I’ve heard this
is not exactly a kosher thing to do) as would finding
all the spots where your programs stops and tossing an
SDL_Quit in there.
(Accidentally calling SDL_Quit more than once isn’t
going to hurt things, right? I sure hope not :slight_smile:

— martin krois wrote:> Hello all.

This is my first post to the sdl-list.

I have made a basic program that setup a window and
draws some objects
(C++/Windows2000), and I must say SDL is great!

All works fine, including fullscreen.

However if I quit the application while in
fullscreen mode, the
resolution i set in SDL will remain.
So if I have a 1280x1024 desktop, I have a 800x600
desktop after running
my app.

If anyone has a way of getting around this I’d be
very gratefull. I
suppose one could set the mode before quitting? But
how do I know what
videomode people ran in the first place - I haven’t
found a
’SDL_GetVideoMode()’?

best regards,

Martin Kr?is

ps.

http://www.libsdl.org/pipermail/sdl/

says year 2024… :slight_smile:


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

=====

-Roger Ostrander


Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

Roger Ostrander wrote:

Hello,

I had this problem, and in my case it was because
SDL_Quit wasn’t being called - I believe SDL_Quit will
reset the resolution to the way it was. An
atexit(SDL_Quit) should work (though I’ve heard this
is not exactly a kosher thing to do) as would finding
all the spots where your programs stops and tossing an
SDL_Quit in there.
(Accidentally calling SDL_Quit more than once isn’t
going to hurt things, right? I sure hope not :slight_smile:

Ok, sounds reasonable. As I have converted my C to C++ I think it will
now be easier to track down where excactly it exits ungracefully if this
is the problem.

Now I have some ideas to work with, at least it’s my code, not SDL that
crashes. A great thanks to all who answered.
:slight_smile:

/martin–
“Beam me up scotty - There’s no intelligent life down here.”