libgoatvr

diff src/vr_openhmd.c @ 8:3d9ec6fe97d7

- added distortion mesh generation for the OpenHMD module (unfinished) - changed internal implementation function naming to use the vrimp_ prefix - added an opengl helper function to load extension entry points
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 20 Sep 2014 13:22:53 +0300
parents 6896f9cf9621
children b536bd21b37f
line diff
     1.1 --- a/src/vr_openhmd.c	Fri Sep 19 15:16:51 2014 +0300
     1.2 +++ b/src/vr_openhmd.c	Sat Sep 20 13:22:53 2014 +0300
     1.3 @@ -27,6 +27,7 @@
     1.4  static int init(void)
     1.5  {
     1.6  	int i, num_hmds;
     1.7 +	float distort_k[6];
     1.8  
     1.9  	if(!(ctx = ohmd_ctx_create())) {
    1.10  		fprintf(stderr, "failed to create OpenHMD context\n");
    1.11 @@ -69,6 +70,14 @@
    1.12  		set_option_int(optdb, VR_OPT_REYE_YRES, (int)(disp_height * FB_EMBIGGEN));
    1.13  	}
    1.14  
    1.15 +	ohmd_device_getf(dev, OHMD_DISTORTION_K, distort_k);
    1.16 +	printf("k: %g %g %g   %g %g %g\n", distort_k[0], distort_k[1], distort_k[2],
    1.17 +			distort_k[3], distort_k[4], distort_k[5]);
    1.18 +	/* TODO: DK2 returns all zeros here ... maybe we should detect that and switch to
    1.19 +	 * using the DK2 distortion mesh from the Oculus SDK. I'll have to connect the DK1
    1.20 +	 * again to finish the barrel distortion method.
    1.21 +	 */
    1.22 +
    1.23  	return 0;
    1.24  }
    1.25  
    1.26 @@ -184,7 +193,7 @@
    1.27  		m.proj_matrix = proj_matrix;
    1.28  		m.begin = begin;
    1.29  		m.present = present;
    1.30 -		m.set_eye_texture = set_eye_texture;
    1.31 +		/*m.set_eye_texture = set_eye_texture;*/
    1.32  		m.recenter = recenter;
    1.33  	}
    1.34  	return &m;