# HG changeset patch # User John Tsiombikas # Date 1414256844 -10800 # Node ID 4d6733229e010e8b03894b474d037c51265a2284 # Parent cd9f1560b909754b6abacf8eea3f812d571f0e40 porting to 0.4.3 (finally on linux) diff -r cd9f1560b909 -r 4d6733229e01 Makefile --- a/Makefile Thu Sep 04 09:01:01 2014 +0300 +++ b/Makefile Sat Oct 25 20:07:24 2014 +0300 @@ -3,7 +3,7 @@ bin = oculus2 CFLAGS = -pedantic -Wall -g `pkg-config --cflags sdl2` -LDFLAGS = $(libgl) `pkg-config --libs sdl2` +LDFLAGS = $(libgl) `pkg-config --libs sdl2` -lovr ifeq ($(shell uname -s), Darwin) libgl = -framework OpenGL -lGLEW diff -r cd9f1560b909 -r 4d6733229e01 src/main.c --- a/src/main.c Thu Sep 04 09:01:01 2014 +0300 +++ b/src/main.c Sat Oct 25 20:07:24 2014 +0300 @@ -257,10 +257,13 @@ * we need to construct a view matrix by combining all the information provided by the oculus * SDK, about the position and orientation of the user's head in the world. */ - pose[eye] = ovrHmd_GetEyePose(hmd, eye); + /* TODO: use ovrHmd_GetEyePoses out of the loop instead */ + pose[eye] = ovrHmd_GetHmdPosePerEye(hmd, eye); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); - glTranslatef(eye_rdesc[eye].ViewAdjust.x, eye_rdesc[eye].ViewAdjust.y, eye_rdesc[eye].ViewAdjust.z); + glTranslatef(eye_rdesc[eye].HmdToEyeViewOffset.x, + eye_rdesc[eye].HmdToEyeViewOffset.y, + eye_rdesc[eye].HmdToEyeViewOffset.z); /* retrieve the orientation quaternion and convert it to a rotation matrix */ quat_to_matrix(&pose[eye].Orientation.x, rot_mat); glMultMatrixf(rot_mat); @@ -540,4 +543,4 @@ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 8, 8, 0, GL_RGB, GL_UNSIGNED_BYTE, img); return tex; -} \ No newline at end of file +}