bool fb_srgb;
bool opt_gear_wireframe;
+unsigned int sdr_ltmap, sdr_ltmap_notex;
+
static float cam_dist = 0.0;
static float cam_theta, cam_phi = 20;
static Vec3 cam_pos;
static Mat4 view_matrix, mouse_view_matrix, proj_matrix;
static TextureSet texman;
static Scene *scn;
-static unsigned int sdr, sdr_post_gamma;
+static unsigned int sdr_post_gamma;
static long prev_msec;
cam_pos = bcent + Vec3(0, user_eye_height, 0);
}
- if(!(sdr = create_program_load("sdr/test.v.glsl", "sdr/test.p.glsl"))) {
- fprintf(stderr, "failed to load test shaders\n");
+ if(!(sdr_ltmap_notex = create_program_load("sdr/lightmap.v.glsl", "sdr/lightmap-notex.p.glsl"))) {
+ return false;
+ }
+
+ if(!(sdr_ltmap = create_program_load("sdr/lightmap.v.glsl", "sdr/lightmap-tex.p.glsl"))) {
return false;
}
- set_uniform_int(sdr, "texmap", 0);
- set_uniform_int(sdr, "lightmap", 1);
+ set_uniform_int(sdr_ltmap, "texmap", 0);
+ set_uniform_int(sdr_ltmap, "lightmap", 1);
if(!fb_srgb) {
sdr_post_gamma = create_program_load("sdr/post_gamma.v.glsl", "sdr/post_gamma.p.glsl");
set_light(1, lpos[1], Vec3(0.6, 0.7, 1.0) * 0.6);
set_light(2, lpos[2], Vec3(0.8, 1.0, 0.8) * 0.3);
- glUseProgram(sdr);
scn->draw();
- glUseProgram(0);
if(show_walk_mesh && scn->walk_mesh) {
glPushAttrib(GL_ENABLE_BIT);
app_quit();
break;
- case 'f':
- app_toggle_fullscreen();
+ case '\n':
+ case '\r':
+ if(mod & MOD_ALT) {
+ app_toggle_fullscreen();
+ }
break;
case '`':
}
break;
+ case 'f':
+ {
+ static float prev_walk_speed = -1.0;
+ if(prev_walk_speed < 0.0) {
+ noclip = true;
+ prev_walk_speed = walk_speed;
+ walk_speed = 1000.0;
+ show_message("fly mode\n");
+ } else {
+ noclip = false;
+ walk_speed = prev_walk_speed;
+ prev_walk_speed = -1.0;
+ show_message("walk mode\n");
+ }
+ }
+ break;
+
case 'p':
if(mod & MOD_CTRL) {
fb_srgb = !fb_srgb;