conworlds
diff src/vr/vr_libovr.c @ 18:e4257df067a1
oh yeah, now the tracking is solid. Wasn't rendering the correct part of the texture before.
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Tue, 26 Aug 2014 12:59:15 +0300 |
parents | 5dc4e2b8f6f5 |
children |
line diff
1.1 --- a/src/vr/vr_libovr.c Sun Aug 24 14:36:00 2014 +0300 1.2 +++ b/src/vr/vr_libovr.c Tue Aug 26 12:59:15 2014 +0300 1.3 @@ -110,6 +110,9 @@ 1.4 1.5 if(!(hmd->HmdCaps & ovrHmdCap_ExtendDesktop)) { 1.6 ovrHmd_AttachToWindow(hmd, win, 0, 0); 1.7 + printf("running in \"direct-to-rift\" mode\n"); 1.8 + } else { 1.9 + printf("running in \"extended desktop\" mode\n"); 1.10 } 1.11 ovrHmd_SetEnabledCaps(hmd, ovrHmdCap_LowPersistence | ovrHmdCap_DynamicPrediction); 1.12 1.13 @@ -229,8 +232,6 @@ 1.14 { 1.15 if(!hmd) return 0; 1.16 1.17 - glDisable(GL_DEPTH_TEST); 1.18 - 1.19 ovrHmd_EndFrame(hmd, pose, &eye_tex[0].Texture); 1.20 new_frame = 1; 1.21 1.22 @@ -242,15 +243,12 @@ 1.23 ovrSizei texsz; 1.24 ovrRecti rect; 1.25 1.26 - vmin = 1.0 - vmax; 1.27 - vmax = 1.0 - vmin; 1.28 - 1.29 glBindTexture(GL_TEXTURE_2D, tex); 1.30 glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, &texsz.w); 1.31 glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_HEIGHT, &texsz.h); 1.32 1.33 rect.Pos.x = (int)(umin * texsz.w); 1.34 - rect.Pos.y = (int)(vmin * texsz.h); 1.35 + rect.Pos.y = (int)((vmin + 1.0 - vmax) * texsz.h); 1.36 rect.Size.w = (int)((umax - umin) * texsz.w); 1.37 rect.Size.h = (int)((vmax - vmin) * texsz.h); 1.38