Merge pull request #22 from jadamcze/windowpos

Constrain the window's aspect ratio
This commit is contained in:
Mikko Mononen 2014-04-11 11:42:33 +03:00
commit 4bcfb17f57

View File

@ -101,7 +101,8 @@ int main(int /*argc*/, char** /*argv*/)
} }
else else
{ {
width = vi->current_w - 20; width = rcMin(vi->current_w, (int)(vi->current_h * 16.0 / 9.0));
width = width - 80;
height = vi->current_h - 80; height = vi->current_h - 80;
screen = SDL_SetVideoMode(width, height, 0, SDL_OPENGL); screen = SDL_SetVideoMode(width, height, 0, SDL_OPENGL);
} }