X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=vrfileman;a=blobdiff_plain;f=src%2Fapp.cc;h=0c82972c41dcade3befd6ff811daf9c90bddc4cc;hp=c3f6b3928c57400a9f04490d01cf4f2c0f4b3b0f;hb=172da567dcbb634b13069e5c12ae8b6a9b3a29dc;hpb=d0cc9ec2f92f149279ebc8f1c29d2be627074488 diff --git a/src/app.cc b/src/app.cc index c3f6b39..0c82972 100644 --- a/src/app.cc +++ b/src/app.cc @@ -8,6 +8,9 @@ #include "backdrop.h" #include "goatvr.h" #include "opt.h" +#include "fs.h" + +static void draw_scene(); int win_width, win_height; float win_aspect; @@ -19,7 +22,6 @@ static bool should_swap; static float cam_theta, cam_phi; static float cam_height = 1.65; -static Mesh *mesh_torus; static bool bnstate[16]; static int prev_x, prev_y; @@ -65,13 +67,14 @@ bool app_init(int argc, char **argv) Mesh::use_custom_sdr_attr = false; - mesh_torus = new Mesh; - gen_torus(mesh_torus, 1.0, 0.25, 32, 32); - if(!init_backdrop()) { return false; } + if(!init_fs()) { + return false; + } + return true; } @@ -80,7 +83,6 @@ void app_cleanup() if(opt.vr) { goatvr_shutdown(); } - delete mesh_torus; cleanup_backdrop(); } @@ -105,7 +107,7 @@ void app_draw() glMatrixMode(GL_MODELVIEW); glLoadMatrixf(view_matrix[0]); - draw_backdrop(); + draw_scene(); } goatvr_draw_done(); @@ -126,7 +128,7 @@ void app_draw() glMatrixMode(GL_MODELVIEW); glLoadMatrixf(view_matrix[0]); - draw_backdrop(); + draw_scene(); app_swap_buffers(); app_redraw(); // since we added animation we need to redisplay even in non-VR mode @@ -134,6 +136,12 @@ void app_draw() assert(glGetError() == GL_NO_ERROR); } +static void draw_scene() +{ + draw_backdrop(); + draw_fs(); +} + void app_reshape(int x, int y) { glViewport(0, 0, x, y);