oculus2

changeset 7:5b04743fd3d0

- changed some loose types to make this example more compatible with C++ programs - enabled overdrive (can't see any difference but what the hell)
author John Tsiombikas <nuclear@member.fsf.org>
date Mon, 15 Sep 2014 03:00:50 +0300
parents 37c753411934
children 9c36ae39ad95 92acd335620e
files src/main.c
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line diff
     1.1 --- a/src/main.c	Fri Sep 05 03:23:19 2014 +0300
     1.2 +++ b/src/main.c	Mon Sep 15 03:00:50 2014 +0300
     1.3 @@ -156,7 +156,7 @@
     1.4  		 * XXX: this doesn't work properly yet due to bugs in the oculus 0.4.1 sdk/driver
     1.5  		 */
     1.6  #ifdef WIN32
     1.7 -		void *sys_win = GetActiveWindow();
     1.8 +		HWND sys_win = GetActiveWindow();
     1.9  		glcfg.OGL.Window = sys_win;
    1.10  		glcfg.OGL.DC = wglGetCurrentDC();
    1.11  		ovrHmd_AttachToWindow(hmd, sys_win, 0, 0);
    1.12 @@ -171,7 +171,8 @@
    1.13  	 * timewrap, which shifts the image before drawing to counter any lattency between the call
    1.14  	 * to ovrHmd_GetEyePose and ovrHmd_EndFrame.
    1.15  	 */
    1.16 -	dcaps = ovrDistortionCap_Chromatic | ovrDistortionCap_Vignette | ovrDistortionCap_TimeWarp;
    1.17 +	dcaps = ovrDistortionCap_Chromatic | ovrDistortionCap_Vignette | ovrDistortionCap_TimeWarp |
    1.18 +		ovrDistortionCap_Overdrive;
    1.19  	if(!ovrHmd_ConfigureRendering(hmd, &glcfg.Config, dcaps, hmd->DefaultEyeFov, eye_rdesc)) {
    1.20  		fprintf(stderr, "failed to configure distortion renderer\n");
    1.21  	}
    1.22 @@ -237,14 +238,14 @@
    1.23  
    1.24  	/* for each eye ... */
    1.25  	for(i=0; i<2; i++) {
    1.26 -		int eye = hmd->EyeRenderOrder[i];
    1.27 +		ovrEyeType eye = hmd->EyeRenderOrder[i];
    1.28  
    1.29  		/* -- viewport transformation --
    1.30  		 * setup the viewport to draw in the left half of the framebuffer when we're
    1.31  		 * rendering the left eye's view (0, 0, width/2, height), and in the right half
    1.32  		 * of the framebuffer for the right eye's view (width/2, 0, width/2, height)
    1.33  		 */
    1.34 -		glViewport(eye == 0 ? 0 : fb_width / 2, 0, fb_width / 2, fb_height);
    1.35 +		glViewport(eye == ovrEye_Left ? 0 : fb_width / 2, 0, fb_width / 2, fb_height);
    1.36  
    1.37  		/* -- projection transformation --
    1.38  		 * we'll just have to use the projection matrix supplied by the oculus SDK for this eye