projects
/
vrfileman
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
cyberenv
[vrfileman]
/
src
/
app.cc
diff --git
a/src/app.cc
b/src/app.cc
index
1de3f89
..
859e6f2
100644
(file)
--- a/
src/app.cc
+++ b/
src/app.cc
@@
-5,7
+5,7
@@
#include "gmath/gmath.h"
#include "mesh.h"
#include "meshgen.h"
#include "gmath/gmath.h"
#include "mesh.h"
#include "meshgen.h"
-#include "sdr.h"
+#include "backdrop.h"
int win_width, win_height;
float win_aspect;
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 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) {
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);
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;
}
return false;
}
@@
-50,6
+48,8
@@
bool app_init(int argc, char **argv)
void app_cleanup()
{
void app_cleanup()
{
+ delete mesh_torus;
+ cleanup_backdrop();
}
void app_draw()
}
void app_draw()
@@
-64,23
+64,7
@@
void app_draw()
glLoadMatrixf(view_mat[0]);
//mesh_torus->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);
app_swap_buffers();
assert(glGetError() == GL_NO_ERROR);