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 Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 340 other followers