X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fgame.c;h=05bdc95d9976ec86d6d5f1f0cab6aa14f01cbf89;hb=32d517e60844b73bc27ffb6ae67061d0429b7927;hp=00f81cc6e670d995e1688a514a9b97dd95a5038c;hpb=49fdb2457dbb7705501264d519e840dd3ca60919;p=vrtris diff --git a/src/game.c b/src/game.c index 00f81cc..05bdc95 100644 --- a/src/game.c +++ b/src/game.c @@ -7,10 +7,11 @@ #include "osd.h" #include "opt.h" +#define DEFSCR "game" + static void calc_framerate(void); static void print_framerate(void); -static float view_matrix[16], proj_matrix[16]; static int should_swap; static unsigned long framerate; @@ -33,10 +34,17 @@ int game_init(int argc, char **argv) return -1; } goatvr_set_origin_mode(GOATVR_HEAD); + goatvr_set_units_scale(10.0f); goatvr_startvr(); should_swap = goatvr_should_swap(); } + + glEnable(GL_DEPTH_TEST); + glEnable(GL_CULL_FACE); + glEnable(GL_LIGHTING); + glEnable(GL_LIGHT0); + return 0; } @@ -101,7 +109,7 @@ void game_display(void) /* non-VR mode */ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - cgm_mperspective(proj_matrix, cgm_deg_to_rad(50.0), win_aspect, 0.5, 500.0); + cgm_mperspective(proj_matrix, cgm_deg_to_rad(40.0), win_aspect, 0.5, 500.0); glMatrixMode(GL_PROJECTION); glLoadMatrixf(proj_matrix); @@ -147,6 +155,12 @@ void game_keyboard(int key, int pressed) } break; + case KEY_HOME: + if(opt.flags & OPT_VR) { + goatvr_recenter(); + } + break; + default: break; }