#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <GL/gl.h>
+#include "opengl.h"
#include "cgmath/cgmath.h"
#include "game.h"
+#include "sdr.h"
#include "level.h"
#include "util.h"
static float cam_theta, cam_phi = 20, cam_dist = 10;
static cgm_vec3 cam_pan;
+static unsigned int sdr;
+
static int ginit(void)
{
+ if(!(sdr = create_program_load("sdr/raydungeon.v.glsl", "sdr/raydungeon.p.glsl"))) {
+ return -1;
+ }
return 0;
}
static void gdestroy(void)
{
+ free_program(sdr);
}
static int gstart(void)
glMatrixMode(GL_MODELVIEW);
glLoadMatrixf(view_mat);
+ glUseProgram(sdr);
+
+ glDepthMask(0);
+ glBegin(GL_TRIANGLES);
+ glTexCoord2f(0, 0); glVertex2f(-1, -1);
+ glTexCoord2f(2, 0); glVertex2f(4, -1);
+ glTexCoord2f(0, 2); glVertex2f(-1, 4);
+ glEnd();
+ glDepthMask(1);
+
+ glUseProgram(0);
+
+
cell = lvl->cells;
glBegin(GL_QUADS);
glColor3f(1, 1, 1);