X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=vrfileman;a=blobdiff_plain;f=src%2Fapp.cc;h=859e6f2e937dab3424b2268a3b045edc782af957;hp=1de3f891b4503ab624000c0be4eb6ffcf507c295;hb=5854b2eec65e297e1b21e8e1716c02516a3bac4a;hpb=dd39621d642e417f1e343cbf813205a658272639 diff --git a/src/app.cc b/src/app.cc index 1de3f89..859e6f2 100644 --- a/src/app.cc +++ b/src/app.cc @@ -5,7 +5,7 @@ #include "gmath/gmath.h" #include "mesh.h" #include "meshgen.h" -#include "sdr.h" +#include "backdrop.h" int win_width, win_height; float win_aspect; @@ -17,8 +17,6 @@ static Mesh *mesh_torus; static bool bnstate[16]; static int prev_x, prev_y; -static unsigned int sdr_grid; - bool app_init(int argc, char **argv) { if(init_opengl() == -1) { @@ -41,7 +39,7 @@ bool app_init(int argc, char **argv) mesh_torus = new Mesh; gen_torus(mesh_torus, 1.0, 0.25, 32, 32); - if(!(sdr_grid = create_program_load("sdr/grid.v.glsl", "sdr/grid.p.glsl"))) { + if(!init_backdrop()) { return false; } @@ -50,6 +48,8 @@ bool app_init(int argc, char **argv) void app_cleanup() { + delete mesh_torus; + cleanup_backdrop(); } void app_draw() @@ -64,23 +64,7 @@ void app_draw() glLoadMatrixf(view_mat[0]); //mesh_torus->draw(); - - Mat4 xform; - xform.scaling(500.0); - glPushMatrix(); - glMultMatrixf(xform[0]); - - bind_program(sdr_grid); - glBegin(GL_QUADS); - glNormal3f(0, 1, 0); - glVertex3f(-1, 0, 1); - glVertex3f(1, 0, 1); - glVertex3f(1, 0, -1); - glVertex3f(-1, 0, -1); - glEnd(); - bind_program(0); - - glPopMatrix(); + draw_backdrop(); app_swap_buffers(); assert(glGetError() == GL_NO_ERROR);