Forcing SDL to Use a Certain Window Size

SDL doesn’t play well with a multi-monitor setup: Either the game window is split over the two displays or one display is set to a different height than the other (making part of the surface unreachable with the mouse) or your desktop is messed up when you exit the full screen mode.

I’ve written a patch that allows you to force SDL to use a certain window size/resolution by setting the environment variable SDL_VIDEO_SIZE to “widthxheight” before starting the game: https://gist.github.com/1429985

Example (bash):

export SDL_VIDEO_SIZE=1024×768

Works best when running the game in a window.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.