projects
/
vrtris
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
runs in VR
[vrtris]
/
src
/
game.c
diff --git
a/src/game.c
b/src/game.c
index
00f81cc
..
05bdc95
100644
(file)
--- a/
src/game.c
+++ b/
src/game.c
@@
-7,10
+7,11
@@
#include "osd.h"
#include "opt.h"
#include "osd.h"
#include "opt.h"
+#define DEFSCR "game"
+
static void calc_framerate(void);
static void print_framerate(void);
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;
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);
return -1;
}
goatvr_set_origin_mode(GOATVR_HEAD);
+ goatvr_set_units_scale(10.0f);
goatvr_startvr();
should_swap = goatvr_should_swap();
}
goatvr_startvr();
should_swap = goatvr_should_swap();
}
+
+ glEnable(GL_DEPTH_TEST);
+ glEnable(GL_CULL_FACE);
+ glEnable(GL_LIGHTING);
+ glEnable(GL_LIGHT0);
+
return 0;
}
return 0;
}
@@
-101,7
+109,7
@@
void game_display(void)
/* non-VR mode */
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
/* 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);
glMatrixMode(GL_PROJECTION);
glLoadMatrixf(proj_matrix);
@@
-147,6
+155,12
@@
void game_keyboard(int key, int pressed)
}
break;
}
break;
+ case KEY_HOME:
+ if(opt.flags & OPT_VR) {
+ goatvr_recenter();
+ }
+ break;
+
default:
break;
}
default:
break;
}