#include "mesh.h"
#include "meshgen.h"
#include "sdr.h"
+#include "texture.h"
int win_width, win_height;
float win_aspect;
static float cam_theta, cam_phi;
static Mesh *mesh_torus;
+static Texture *tex_grid;
static bool bnstate[16];
static int prev_x, prev_y;
if(!(sdr_grid = create_program_load("sdr/grid.v.glsl", "sdr/grid.p.glsl"))) {
return false;
}
+ if(!(tex_grid = load_texture("data/purple_grid.png"))) {
+ delete tex_grid;
+ return false;
+ }
return true;
}
glMultMatrixf(xform[0]);
bind_program(sdr_grid);
+ bind_texture(tex_grid);
+
glBegin(GL_QUADS);
glNormal3f(0, 1, 0);
glVertex3f(-1, 0, 1);
glVertex3f(1, 0, -1);
glVertex3f(-1, 0, -1);
glEnd();
+
+ bind_texture(0);
bind_program(0);
glPopMatrix();