SDL_GetCurrentDisplayMode vs SDL_GetDesktopDisplayMode

What’s the difference between SDL_GetCurrentDisplayMode and SDL_GetDesktopDisplayMode?
They both return the same value.

Matters in multimonitor setups. One returns the resolution of
individual displays (i.e. monitors), the other returns the resolution
of the virtual desktop (which contains all the displays).

On X11 the desktop can be larger than the display too (which would
result in panning), but that case is too rare as far as I know… I
only saw that behavior with a SDL bug regarding fullscreen (changing
the video mode but not the desktop size).

2013/7/23, axper <483ken at gmail.com>:> What’s the difference between SDL_GetCurrentDisplayMode and

SDL_GetDesktopDisplayMode?
They both return the same value.

Hmm, still same output on a multi-monitor setup, using latest hg version. SDL_GetCurrentDisplayMode and SDL_GetDesktopDisplayMode both return 1366x768, 59hz.
“xrandr” output:

Code:

Screen 0: minimum 320 x 200, current 2966 x 900, maximum 8192 x 8192
LVDS1 connected 1366x768+0+0 (normal left inverted right x axis y axis) 344mm x 194mm
1366x768 60.0*+
1024x768 60.0
800x600 60.3 56.2
640x480 59.9
VGA1 connected 1600x900+1366+0 (normal left inverted right x axis y axis) 443mm x 249mm
1600x900 60.0*+
1440x900 75.0 59.9
1280x800 74.9 59.8
1152x864 75.0
1024x768 75.1 70.1 60.0
832x624 74.6
800x600 72.2 75.0 60.3 56.2
640x480 72.8 75.0 66.7 60.0
720x400 70.1
HDMI1 disconnected (normal left inverted right x axis y axis)
DP1 disconnected (normal left inverted right x axis y axis)

Any ideas?

Sik wrote:> Matters in multimonitor setups. One returns the resolution of

individual displays (i.e. monitors), the other returns the resolution
of the virtual desktop (which contains all the displays).

On X11 the desktop can be larger than the display too (which would
result in panning), but that case is too rare as far as I know… I
only saw that behavior with a SDL bug regarding fullscreen (changing
the video mode but not the desktop size).

2013/7/23, axper <@axper>:

What’s the difference between SDL_GetCurrentDisplayMode and
SDL_GetDesktopDisplayMode?
They both return the same value.


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

If I remember correctly, when you’ve got a fullscreen window that has
changed the resolution of a display GetCurrentDisplayMode will return
the mode the screen is currently running and GetDesktopDisplayMode
should return the mode that the screen originally had, before you
changed it.

? DavidOn 26/07/13 22:43, axper wrote:

Hmm, still same output on a multi-monitor setup, using latest hg
version. SDL_GetCurrentDisplayMode and SDL_GetDesktopDisplayMode both
return 1366x768, 59hz.
“xrandr” output:

Code:

Screen 0: minimum 320 x 200, current 2966 x 900, maximum 8192 x 8192
LVDS1 connected 1366x768+0+0 (normal left inverted right x axis y
axis) 344mm x 194mm
1366x768 60.0*+
1024x768 60.0
800x600 60.3 56.2
640x480 59.9
VGA1 connected 1600x900+1366+0 (normal left inverted right x axis y
axis) 443mm x 249mm
1600x900 60.0*+
1440x900 75.0 59.9
1280x800 74.9 59.8
1152x864 75.0
1024x768 75.1 70.1 60.0
832x624 74.6
800x600 72.2 75.0 60.3 56.2
640x480 72.8 75.0 66.7 60.0
720x400 70.1
HDMI1 disconnected (normal left inverted right x axis y axis)
DP1 disconnected (normal left inverted right x axis y axis)

Any ideas?

Sik wrote:
Matters in multimonitor setups. One returns the resolution of
individual displays (i.e. monitors), the other returns the resolution
of the virtual desktop (which contains all the displays).

On X11 the desktop can be larger than the display too (which would
result in panning), but that case is too rare as far as I know… I
only saw that behavior with a SDL bug regarding fullscreen (changing
the video mode but not the desktop size).

2013/7/23, axper <>:

Quote:
What’s the difference between SDL_GetCurrentDisplayMode and
SDL_GetDesktopDisplayMode?
They both return the same value.


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

David Gow wrote:

If I remember correctly, when you’ve got a fullscreen window that has
changed the resolution of a display GetCurrentDisplayMode will return
the mode the screen is currently running and GetDesktopDisplayMode
should return the mode that the screen originally had, before you
changed it.

? David

Oh I see now, thanks!