+ glMatrixMode(GL_MODELVIEW);
+ glLoadMatrixf(view_matrix[0]);
+
+ draw_scene();
+ }
+ goatvr_draw_done();
+
+ if(should_swap) {
+ app_swap_buffers();
+ }
+ app_redraw(); // in VR mode, force continuous redraw
+
+ } else {
+ // regular monoscopic mode
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+
+ view_matrix = Mat4::identity;
+ view_matrix.pre_rotate_x(deg_to_rad(cam_phi));
+ view_matrix.pre_rotate_y(deg_to_rad(cam_theta));
+ view_matrix.pre_translate(0, -cam_height, 0);
+
+ glMatrixMode(GL_MODELVIEW);
+ glLoadMatrixf(view_matrix[0]);
+
+ draw_scene();
+
+ app_swap_buffers();
+ app_redraw(); // since we added animation we need to redisplay even in non-VR mode
+ }