oculus1

diff src/vr.cc @ 16:f3672317e5c2

made teapots many sizes and more colorful, added phong shader
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 21 Sep 2013 05:22:48 +0300
parents 402cbb6d9ce3
children cfe4979ab3eb
line diff
     1.1 --- a/src/vr.cc	Sat Sep 21 04:15:20 2013 +0300
     1.2 +++ b/src/vr.cc	Sat Sep 21 05:22:48 2013 +0300
     1.3 @@ -98,9 +98,15 @@
     1.4  		float proj_shift = center_dist_meters - info.LensSeparationDistance * 0.5;
     1.5  		vr_ctx.info.proj_center_offset = 4.0 * proj_shift / info.HScreenSize;
     1.6  
     1.7 -		// grab the display name
     1.8 +		// grab the display info
     1.9  		vr_ctx.info.display = new char[strlen(info.DisplayDeviceName) + 1];
    1.10  		strcpy(vr_ctx.info.display, info.DisplayDeviceName);
    1.11 +
    1.12 +		vr_ctx.info.display_xoffs = info.DesktopX;
    1.13 +		vr_ctx.info.display_yoffs = info.DesktopY;
    1.14 +
    1.15 +		printf("display: \"%s\" offset: %+d %+d\n", vr_ctx.info.display,
    1.16 +				vr_ctx.info.display_xoffs, vr_ctx.info.display_yoffs);
    1.17  	}
    1.18  
    1.19  	// get the sensor device
    1.20 @@ -209,6 +215,17 @@
    1.21  	return true;
    1.22  }
    1.23  
    1.24 +extern "C" const char *vr_get_display_name(void)
    1.25 +{
    1.26 +	return vr_ctx.info.display;
    1.27 +}
    1.28 +
    1.29 +extern "C" void vr_get_display_pos(int *xptr, int *yptr)
    1.30 +{
    1.31 +	*xptr = vr_ctx.info.display_xoffs;
    1.32 +	*yptr = vr_ctx.info.display_yoffs;
    1.33 +}
    1.34 +
    1.35  extern "C" int vr_get_width(void)
    1.36  {
    1.37  	return vr_ctx.info.width;