X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=laserbrain_demo;a=blobdiff_plain;f=src%2Fapp.cc;h=96e92f332ae7231d8e377801bfab2cc4dd106397;hp=30222f9ce50d57444519b7aef8e6d427dc4df427;hb=197bafc7f54795243d4c217c2efcf41f01d4100d;hpb=844f36f03073c5db86a8acd2cf7cd1a89e1a16b9 diff --git a/src/app.cc b/src/app.cc index 30222f9..96e92f3 100644 --- a/src/app.cc +++ b/src/app.cc @@ -41,10 +41,10 @@ bool opt_gear_wireframe; TextureSet texman; SceneSet sceneman; -unsigned int sdr_ltmap, sdr_ltmap_notex; - int fpexcept_enabled; +unsigned int dbg_key_pending; + static Avatar avatar; static float cam_dist = 0.0; @@ -175,18 +175,6 @@ bool app_init(int argc, char **argv) } exui_setnode(&exslot_left.node); - if(!(sdr_ltmap_notex = create_program_load("sdr/lightmap.v.glsl", "sdr/lightmap-notex.p.glsl"))) { - return false; - } - set_uniform_int(sdr_ltmap_notex, "texmap", MTL_TEX_DIFFUSE); - set_uniform_int(sdr_ltmap_notex, "lightmap", MTL_TEX_LIGHTMAP); - - if(!(sdr_ltmap = create_program_load("sdr/lightmap.v.glsl", "sdr/lightmap-tex.p.glsl"))) { - return false; - } - set_uniform_int(sdr_ltmap, "texmap", MTL_TEX_DIFFUSE); - set_uniform_int(sdr_ltmap, "lightmap", MTL_TEX_LIGHTMAP); - if(!fb_srgb) { sdr_post_gamma = create_program_load("sdr/post_gamma.v.glsl", "sdr/post_gamma.p.glsl"); } @@ -195,6 +183,11 @@ bool app_init(int argc, char **argv) if(!rend->init()) { return false; } + if(opt.reflect) { + rend->ropt |= RENDER_MIRRORS; + } else { + rend->ropt &= ~RENDER_MIRRORS; + } rend->set_scene(mscn); glUseProgram(0); @@ -418,7 +411,7 @@ void app_display() ImGui::GetIOPtr()->DeltaTime = dt; ImGui::NewFrame(); - ImGui::ShowTestWindow(); + //ImGui::ShowTestWindow(); } glClearColor(1, 1, 1, 1); @@ -433,8 +426,12 @@ void app_display() for(int i=0; i<2; i++) { // for each eye goatvr_draw_eye(i); - vp_width = goatvr_get_fb_eye_width(i); - vp_height = goatvr_get_fb_eye_height(i); + if(goatvr_get_fb_texture()) { + vp_width = goatvr_get_fb_eye_width(i); + vp_height = goatvr_get_fb_eye_height(i); + } else { + vp_width = win_width / 2; + } proj_matrix = goatvr_projection_matrix(i, NEAR_CLIP, FAR_CLIP); glMatrixMode(GL_PROJECTION); @@ -671,6 +668,13 @@ void app_keyboard(int key, bool pressed) case KEY_RIGHT: exui_change_tab(1); break; + + case KEY_F5: + case KEY_F6: + case KEY_F7: + case KEY_F8: + dbg_key_pending |= 1 << (key - KEY_F5); + break; } }