# HG changeset patch # User John Tsiombikas # Date 1409047155 -10800 # Node ID e4257df067a12f0bc411c6939a345bb8e39aba8d # Parent 9b0db7dbde6e70d50d2807dfe1fa8958aac681a6 oh yeah, now the tracking is solid. Wasn't rendering the correct part of the texture before. diff -r 9b0db7dbde6e -r e4257df067a1 src/game.cc --- a/src/game.cc Sun Aug 24 14:36:00 2014 +0300 +++ b/src/game.cc Tue Aug 26 12:59:15 2014 +0300 @@ -147,11 +147,9 @@ if(eye == 0 || !vr_view_matrix(eye < 0 ? 0 : 1, mat)) { glLoadIdentity(); } else { - glLoadIdentity(); - //glLoadMatrixf(mat); + glLoadMatrixf(mat); } glMultTransposeMatrixf(view_matrix[0]); - glMultMatrixf(mat); draw_scene(); } diff -r 9b0db7dbde6e -r e4257df067a1 src/vr/vr_libovr.c --- a/src/vr/vr_libovr.c Sun Aug 24 14:36:00 2014 +0300 +++ b/src/vr/vr_libovr.c Tue Aug 26 12:59:15 2014 +0300 @@ -110,6 +110,9 @@ if(!(hmd->HmdCaps & ovrHmdCap_ExtendDesktop)) { ovrHmd_AttachToWindow(hmd, win, 0, 0); + printf("running in \"direct-to-rift\" mode\n"); + } else { + printf("running in \"extended desktop\" mode\n"); } ovrHmd_SetEnabledCaps(hmd, ovrHmdCap_LowPersistence | ovrHmdCap_DynamicPrediction); @@ -229,8 +232,6 @@ { if(!hmd) return 0; - glDisable(GL_DEPTH_TEST); - ovrHmd_EndFrame(hmd, pose, &eye_tex[0].Texture); new_frame = 1; @@ -242,15 +243,12 @@ ovrSizei texsz; ovrRecti rect; - vmin = 1.0 - vmax; - vmax = 1.0 - vmin; - glBindTexture(GL_TEXTURE_2D, tex); glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, &texsz.w); glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_HEIGHT, &texsz.h); rect.Pos.x = (int)(umin * texsz.w); - rect.Pos.y = (int)(vmin * texsz.h); + rect.Pos.y = (int)((vmin + 1.0 - vmax) * texsz.h); rect.Size.w = (int)((umax - umin) * texsz.w); rect.Size.h = (int)((vmax - vmin) * texsz.h);