From 49e4020437026e59d88090359e1dc708a27a2827 Mon Sep 17 00:00:00 2001 From: Themaister Date: Wed, 10 Apr 2013 20:42:54 +0200 Subject: [PATCH] Move forced IOS viewport logic further up. If using multipass, the forced viewport update will ruin the viewport. --- gfx/gl.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/gfx/gl.c b/gfx/gl.c index 274c968d43..9e9b5ecfcb 100644 --- a/gfx/gl.c +++ b/gfx/gl.c @@ -657,9 +657,6 @@ void gl_init_fbo(void *data, unsigned width, unsigned height) if (scale_last.valid) gl->fbo_pass++; - if (gl->fbo_pass <= 0) - gl->fbo_pass = 1; - if (!scale.valid) { scale.scale_x = 1.0f; @@ -1343,6 +1340,10 @@ static bool gl_frame(void *data, const void *frame, unsigned width, unsigned hei gl_shader_use_func(gl, 1); +#ifdef IOS // Apparently the viewport is lost each frame, thanks apple. + gl_set_viewport(gl, gl->win_width, gl->win_height, false, true); +#endif + #ifdef HAVE_FBO // Render to texture in first pass. if (gl->fbo_inited) @@ -1363,10 +1364,6 @@ static bool gl_frame(void *data, const void *frame, unsigned width, unsigned hei gl_update_resize(gl); } -#ifdef IOS // Apparently the viewport is lost each frame, thanks apple. - gl_set_viewport(gl, gl->win_width, gl->win_height, false, true); -#endif - if (frame) // Can be NULL for frame dupe / NULL render. { gl->tex_index = (gl->tex_index + 1) & TEXTURES_MASK;