#include "gmath/gmath.h"
#include "mesh.h"
#include "meshgen.h"
-#include "sdr.h"
+#include "backdrop.h"
int win_width, win_height;
float win_aspect;
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) {
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;
}
void app_cleanup()
{
+ delete mesh_torus;
+ cleanup_backdrop();
}
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);