# HG changeset patch # User John Tsiombikas # Date 1428286631 -10800 # Node ID 5136dfcea7b1856fd9128ff62cd0936d396561c5 # Parent e819f63535b3431485b8a21b7d5c72ca95e69162 ported to OVR 0.5.0.1 diff -r e819f63535b3 -r 5136dfcea7b1 Makefile.in --- a/Makefile.in Mon Mar 30 05:51:22 2015 +0300 +++ b/Makefile.in Mon Apr 06 05:17:11 2015 +0300 @@ -7,7 +7,7 @@ ifdef use_libovr mod_cflags += -DUSE_LIBOVR - mod_libs += -lovr + mod_libs += -lOVR endif ifdef use_openhmd mod_cflags += -DUSE_OPENHMD diff -r e819f63535b3 -r 5136dfcea7b1 example/Makefile --- a/example/Makefile Mon Mar 30 05:51:22 2015 +0300 +++ b/example/Makefile Mon Apr 06 05:17:11 2015 +0300 @@ -2,13 +2,13 @@ obj = $(src:.c=.o) bin = test -vrlib_root = .. +vrlib_root = $(shell pwd)/.. vrlib = $(vrlib_root)/libgoatvr.so warn = -Wall CFLAGS = -pedantic $(warn) -g `pkg-config --cflags sdl2` -I$(vrlib_root)/src -LDFLAGS = $(libgl) `pkg-config --libs sdl2` -L$(vrlib_root) -lgoatvr -Wl,-rpath -Wl,$(vrlib_root)/ +LDFLAGS = $(libgl) -L$(vrlib_root) -Wl,-rpath=$(vrlib_root) -lgoatvr `pkg-config --libs sdl2` ifeq ($(shell uname -s), Darwin) libgl = -framework OpenGL -lGLEW diff -r e819f63535b3 -r 5136dfcea7b1 example/src/main.c --- a/example/src/main.c Mon Mar 30 05:51:22 2015 +0300 +++ b/example/src/main.c Mon Apr 06 05:17:11 2015 +0300 @@ -129,10 +129,12 @@ SDL_GetWindowPosition(win, &prev_x, &prev_y); SDL_SetWindowPosition(win, vr_geti(VR_WIN_XOFFS), vr_geti(VR_WIN_YOFFS)); SDL_SetWindowFullscreen(win, SDL_WINDOW_FULLSCREEN_DESKTOP); + SDL_SetRelativeMouseMode(1); } else { /* return to windowed mode and move the window back to its original position */ SDL_SetWindowFullscreen(win, 0); SDL_SetWindowPosition(win, prev_x, prev_y); + SDL_SetRelativeMouseMode(0); } } diff -r e819f63535b3 -r 5136dfcea7b1 src/vr_libovr.c --- a/src/vr_libovr.c Mon Mar 30 05:51:22 2015 +0300 +++ b/src/vr_libovr.c Mon Apr 06 05:17:11 2015 +0300 @@ -23,7 +23,7 @@ #endif /* undef this if you want the retarded health and safety warning screen */ -#define DISABLE_RETARDED_HEALTH_WARNING +#undef DISABLE_RETARDED_HEALTH_WARNING /* just dropping the prototype here to avoid including CAPI_HSWDisplay.h */ OVR_EXPORT void ovrhmd_EnableHSWDisplaySDKRender(ovrHmd hmd, ovrBool enabled); @@ -48,7 +48,7 @@ int use_fake = 0; ovrTrackingCaps tracking; - if(!ovr_Initialize()) { + if(!ovr_Initialize(0)) { return -1; } printf("initialized LibOVR %s\n", ovr_GetVersionString()); @@ -149,8 +149,7 @@ } ovrHmd_SetEnabledCaps(hmd, ovrHmdCap_LowPersistence | ovrHmdCap_DynamicPrediction); - dcaps = ovrDistortionCap_Chromatic | ovrDistortionCap_TimeWarp | - ovrDistortionCap_Overdrive | ovrDistortionCap_NoRestore; + dcaps = ovrDistortionCap_TimeWarp | ovrDistortionCap_Overdrive; #ifdef OVR_OS_LINUX dcaps |= ovrDistortionCap_LinuxDevFullscreen; #endif @@ -323,7 +322,7 @@ inside_begin_end = 0; if(cur_prog) { - glUseProgram(0); + /*glUseProgram(0);*/ } return 1;