fixed mirror rendering for goatvr backends which don't use an fbo
authorJohn Tsiombikas <nuclear@member.fsf.org>
Sun, 13 May 2018 09:47:33 +0000 (12:47 +0300)
committerJohn Tsiombikas <nuclear@member.fsf.org>
Sun, 13 May 2018 09:47:33 +0000 (12:47 +0300)
src/app.cc

index 21e8acc..96e92f3 100644 (file)
@@ -426,8 +426,12 @@ void app_display()
                for(int i=0; i<2; i++) {
                        // for each eye
                        goatvr_draw_eye(i);
-                       vp_width = goatvr_get_fb_eye_width(i);
-                       vp_height = goatvr_get_fb_eye_height(i);
+                       if(goatvr_get_fb_texture()) {
+                               vp_width = goatvr_get_fb_eye_width(i);
+                               vp_height = goatvr_get_fb_eye_height(i);
+                       } else {
+                               vp_width = win_width / 2;
+                       }
 
                        proj_matrix = goatvr_projection_matrix(i, NEAR_CLIP, FAR_CLIP);
                        glMatrixMode(GL_PROJECTION);