OpenGL: Fix aspect ratio calculation for gles2

This commit is contained in:
Jeffrey Pfau 2016-02-08 20:08:18 -08:00
parent d8ad87504d
commit d481bd29fe
1 changed files with 4 additions and 4 deletions

View File

@ -156,10 +156,10 @@ static void GBAGLES2ContextResized(struct VideoBackend* v, unsigned w, unsigned
unsigned drawW = w; unsigned drawW = w;
unsigned drawH = h; unsigned drawH = h;
if (v->lockAspectRatio) { if (v->lockAspectRatio) {
if (w * 2 > h * 3) { if (w * v->height > h * v->width) {
drawW = h * 3 / 2; drawW = h * v->width / v->height;
} else if (w * 2 < h * 3) { } else if (w * v->height < h * v->width) {
drawH = w * 2 / 3; drawH = w * v->height / v->width;
} }
} }
glViewport(0, 0, v->width, v->height); glViewport(0, 0, v->width, v->height);