oculus1

diff src/main.cc @ 3:b069a5c27388

added a couple more stuff, fixed all the LibOVR line endings
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 15 Sep 2013 04:10:05 +0300
parents e2f9e4603129
children bb81990dc7c8
line diff
     1.1 --- a/src/main.cc	Sat Sep 14 17:51:03 2013 +0300
     1.2 +++ b/src/main.cc	Sun Sep 15 04:10:05 2013 +0300
     1.3 @@ -26,13 +26,13 @@
     1.4  
     1.5  int main(int argc, char **argv)
     1.6  {
     1.7 +	glutInitWindowSize(1280, 800);
     1.8  	glutInit(&argc, argv);
     1.9  
    1.10  	if(!parse_args(argc, argv)) {
    1.11  		return 1;
    1.12  	}
    1.13  
    1.14 -	glutInitWindowSize(1280, 800);
    1.15  	glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);
    1.16  	glutCreateWindow("oculus test 01");
    1.17  
    1.18 @@ -63,7 +63,7 @@
    1.19  	glEnable(GL_LIGHTING);
    1.20  
    1.21  	if(vr_init(VR_INIT_OCULUS) == -1) {
    1.22 -		return false;
    1.23 +		//return false;
    1.24  	}
    1.25  	return true;
    1.26  }
    1.27 @@ -75,6 +75,15 @@
    1.28  
    1.29  static void disp()
    1.30  {
    1.31 +	// test rift sensor
    1.32 +	float quat[4], euler[3];
    1.33 +
    1.34 +	vr_get_rotation(quat);
    1.35 +	vr_get_rotation_euler(euler);
    1.36 +
    1.37 +	printf("q(%.3f + %.3fi + %.3fj %.3fk)", quat[3], quat[0], quat[1], quat[2]);
    1.38 +	printf(" - euler(%.3f %.3f %.3f)\n", euler[0], euler[1], euler[2]);
    1.39 +
    1.40  	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    1.41  
    1.42  	glMatrixMode(GL_PROJECTION);