static int should_swap;
static unsigned long framerate;
+
int game_init(int argc, char **argv)
{
if(init_opengl() == -1) {
return -1;
}
goatvr_set_origin_mode(GOATVR_HEAD);
+ goatvr_set_units_scale(10.0f);
goatvr_startvr();
should_swap = goatvr_should_swap();
static void update(float dt)
{
- int num_vr_sticks;
-
- if((num_vr_sticks = goatvr_num_sticks()) > 0) {
- float p[2];
- goatvr_stick_pos(0, p);
- /* TODO */
- }
-
screen->update(dt);
}
}
break;
+ case KEY_HOME:
+ if(opt.flags & OPT_VR) {
+ goatvr_recenter();
+ }
+ break;
+
default:
break;
}
void game_gamepad_axis(int axis, float val)
{
+ joy_axis[axis] = val;
}
void game_gamepad_button(int bn, int pressed)
{
+ if(pressed) {
+ joy_bnstate |= (1 << bn);
+ } else {
+ joy_bnstate &= ~(1 << bn);
+ }
}
static void calc_framerate(void)