1
\$\begingroup\$

I have a multi-monitor setup with two displays, both 1920x1200. In games, I can only select resolutions > 1920x1200 (like 2560x1200) which makes games unusable.

Full screen doesn't work either because it switches one display to 800x600 which means I can't reach the close button... I have to kill the game and then, I have to restore my desktop because all windows are moved/resized.

How can I force SDL to use any resolution that I want?

\$\endgroup\$

2 Answers 2

1
\$\begingroup\$

If this is a game you're making with SDL, then use SDL_SetVideoMode to set any resolution you want. Just pass in values for width and height.

If this is a game you're trying to play that uses SDL, then you'll have to provide more details, such as what the game is (also, Gaming.SE would be better suited for such a question)

[EDIT] If the game uses SDL to get a list of video modes, it calls SDL_ListModes. There is currently no way to influence the result of this method with, say, environment variables.

\$\endgroup\$
6
  • \$\begingroup\$ I was hoping that there is a hidden env variable or something that allows me to force any resolution, no matter what SDL thinks as valid. On a similar train of thought, how does SDL know the available resolutions? Maybe I can add something to this list. \$\endgroup\$ Dec 1, 2011 at 13:42
  • \$\begingroup\$ @AaronDigulla Is this for a game you're making, or a game you're trying to play? \$\endgroup\$
    – thedaian
    Dec 1, 2011 at 14:48
  • \$\begingroup\$ It's a game that I want to play. I want to know if the game uses a SDL function to figure out the available resolutions and how I can influence this process. If that isn't possible, then I'll have to report a bug :-/ \$\endgroup\$ Dec 1, 2011 at 19:51
  • \$\begingroup\$ Without knowing what the game is, it's impossible to know if the game uses an SDL function to figure out available resolutions. If it does, it probably uses SDL_ListModes, and as far as I know, it's impossible to influence that. \$\endgroup\$
    – thedaian
    Dec 1, 2011 at 20:09
  • 1
    \$\begingroup\$ @AaronDigulla It seems that, for Windows, SDL_ListModes gets its info from EnumDisplaySettings. I don't believe there's any way to influence the value, since it uses the ENUM_CURRENT_SETTINGS mode. If you want to know how it works for operating systems other than Windows, then I suggest you search through the source code. \$\endgroup\$
    – thedaian
    Dec 3, 2011 at 2:16
1
\$\begingroup\$

In the mean time, I've written a patch for SDL 1.2 which allows to force a screen size down its throat: http://blog.pdark.de/2011/12/04/forcing-sdl-to-use-a-certain-window-size/

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .