oculus2_psprite

changeset 19:1a832e88854a

now also works on linux with 0.4.4
author John Tsiombikas <nuclear@member.fsf.org>
date Wed, 14 Jan 2015 07:11:11 +0200
parents 64089dd45d50
children 6a3a9840c303
files src/main.c
diffstat 1 files changed, 4 insertions(+), 5 deletions(-) [+]
line diff
     1.1 --- a/src/main.c	Sun Jan 11 19:03:30 2015 +0200
     1.2 +++ b/src/main.c	Wed Jan 14 07:11:11 2015 +0200
     1.3 @@ -158,7 +158,6 @@
     1.4  	glcfg.OGL.DC = wglGetCurrentDC();
     1.5  #else
     1.6  	glcfg.OGL.Disp = glXGetCurrentDisplay();
     1.7 -	glcfg.OGL.Win = glXGetCurrentDrawable();
     1.8  #endif
     1.9  
    1.10  	if(hmd->HmdCaps & ovrHmdCap_ExtendDesktop) {
    1.11 @@ -171,7 +170,7 @@
    1.12  #ifdef WIN32
    1.13  		ovrHmd_AttachToWindow(hmd, glcfg.OGL.Window, 0, 0);
    1.14  #else
    1.15 -		ovrHmd_AttachToWindow(hmd, (void*)glcfg.OGL.Win, 0, 0);
    1.16 +		ovrHmd_AttachToWindow(hmd, (void*)glXGetCurrentDrawable(), 0, 0);
    1.17  #endif
    1.18  		printf("running in \"direct-hmd\" mode\n");
    1.19  	}
    1.20 @@ -233,8 +232,8 @@
    1.21  		/* on linux for now we have to deal with screen rotation during rendering. The docs are promoting
    1.22  		 * not rotating the DK2 screen globally
    1.23  		 */
    1.24 -		glcfg.OGL.Header.RTSize.w = hmd->Resolution.h;
    1.25 -		glcfg.OGL.Header.RTSize.h = hmd->Resolution.w;
    1.26 +		glcfg.OGL.Header.BackBufferSize.w = hmd->Resolution.h;
    1.27 +		glcfg.OGL.Header.BackBufferSize.h = hmd->Resolution.w;
    1.28  
    1.29  		distort_caps |= ovrDistortionCap_LinuxDevFullscreen;
    1.30  		ovrHmd_ConfigureRendering(hmd, &glcfg.Config, distort_caps, hmd->DefaultEyeFov, eye_rdesc);
    1.31 @@ -245,7 +244,7 @@
    1.32  		SDL_SetWindowPosition(win, prev_x, prev_y);
    1.33  
    1.34  #ifdef OVR_OS_LINUX
    1.35 -		glcfg.OGL.Header.RTSize = hmd->Resolution;
    1.36 +		glcfg.OGL.Header.BackBufferSize = hmd->Resolution;
    1.37  
    1.38  		distort_caps &= ~ovrDistortionCap_LinuxDevFullscreen;
    1.39  		ovrHmd_ConfigureRendering(hmd, &glcfg.Config, distort_caps, hmd->DefaultEyeFov, eye_rdesc);