How to detect if the screen resolution changed? (windowed)

How can I know when the screen resolution is changed (not in fullscreen mode) by the OS?

I searched in the documentation and cant find anything. =(

Thanks

I’d assume SDL would get a window resize event (fired after you release the
click from the resize, at least in the Microsoft windows manager)…

-OzOn Sat, Feb 4, 2012 at 10:09 PM, RodrigoCard wrote:

**
How can I know when the screen resolution is changed (not in fullscreen
mode) by the OS?

I searched in the documentation and cant find anything. =(

Thanks


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

I tested this on OS X 10.7 and got no events.
I suppose that SDL send a RESIZED event only if the app is fullscreen.
But I did not test that, because I want to know the resolution change when my app is windowed.

I want to know that because I need to reposition some windows according to the new screen bounds…

MrOzBarry wrote:> I’d assume SDL would get a window resize event (fired after you release the click from the resize, at least in the Microsoft windows manager)…

-Oz

On Sat, Feb 4, 2012 at 10:09 PM, RodrigoCard <@Rodrigo_C_Rocha (@Rodrigo_C_Rocha)> wrote:

  How can I know when the screen resolution is changed (not in fullscreen mode) by the OS?

I searched in the documentation and cant find anything. =(

Thanks


SDL mailing list
SDL at lists.libsdl.org (SDL at lists.libsdl.org)
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org (http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)

Sorry, I should have asked, are you using SDL2/1.3 ?
Check out
http://wiki.libsdl.org/moin.cgi/SDL_WindowEvent?highlight=(\bCategoryStruct\b)|(CategoryEvents)|(SGStructures)

It may be that you’re not checking for the window resize event properly.

Take care,
-OzOn Sat, Feb 4, 2012 at 10:48 PM, RodrigoCard wrote:

**
I tested this on OS X 10.7 and got no events.
I suppose that SDL send a RESIZED event only if the app is fullscreen.
But I did not test that, because I want to know the resolution change when
my app is windowed.

I want to know that because I need to reposition some windows according to
the new screen bounds…

MrOzBarry wrote:

I’d assume SDL would get a window resize event (fired after you release
the click from the resize, at least in the Microsoft windows manager)…

-Oz

On Sat, Feb 4, 2012 at 10:09 PM, RodrigoCard <> wrote:

Quote:

How can I know when the screen resolution is changed (not in fullscreen
mode) by the OS?

I searched in the documentation and cant find anything. =(

Thanks


SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

SDL currently doesn’t have an event for this.

For SDL 2.0, If you wanted to do something like this, you might create an
SDL_DISPLAY_CHANGED event which has the display index and new rectangle.
Make sure you update the data that SDL_GetDisplayBounds() looks at before
sending the event.

This sounds generally useful, so if you add it, please submit a patch for
it so other people can use it:
http://bugzilla.libsdl.org

Cheers!On Sat, Feb 4, 2012 at 10:09 PM, RodrigoCard wrote:

**
How can I know when the screen resolution is changed (not in fullscreen
mode) by the OS?

I searched in the documentation and cant find anything. =(

Thanks


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Yeah, I searched how to get this event in cocoa, I think I can try to add this in SDL.

Sam Lantinga wrote:> SDL currently doesn’t have an event for this.

For SDL 2.0, If you wanted to do something like this, you might create an SDL_DISPLAY_CHANGED event which has the display index and new rectangle. ?Make sure you update the data that?SDL_GetDisplayBounds() looks at before sending the event.

This sounds generally useful, so if you add it, please submit a patch for it so other people can use it:
http://bugzilla.libsdl.org (http://bugzilla.libsdl.org)

Cheers!

On Sat, Feb 4, 2012 at 10:09 PM, RodrigoCard <@Rodrigo_C_Rocha (@Rodrigo_C_Rocha)> wrote:

   	How can I know when the screen resolution is changed (not in fullscreen mode) by the OS?

I searched in the documentation and cant find anything. =(

Thanks


SDL mailing list
SDL at lists.libsdl.org (SDL at lists.libsdl.org)
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org (http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)

What’s the point? I mean if it’s not there to easily find then either
nearly no one else wanted it or there is another way to skin that cat. I’m
interested either way. Maybe there is an easy way to do what you want.
Still you have every right to want to do anything you want to do. I just
wonder what’s up.On Sat, Feb 4, 2012 at 9:09 PM, RodrigoCard wrote:

**
How can I know when the screen resolution is changed (not in fullscreen
mode) by the OS?

I searched in the documentation and cant find anything. =(

Thanks


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org