libgoatvr

changeset 28:5136dfcea7b1

ported to OVR 0.5.0.1
author John Tsiombikas <nuclear@member.fsf.org>
date Mon, 06 Apr 2015 05:17:11 +0300
parents e819f63535b3
children ddaa9c764030
files Makefile.in example/Makefile example/src/main.c src/vr_libovr.c
diffstat 4 files changed, 9 insertions(+), 8 deletions(-) [+]
line diff
     1.1 --- a/Makefile.in	Mon Mar 30 05:51:22 2015 +0300
     1.2 +++ b/Makefile.in	Mon Apr 06 05:17:11 2015 +0300
     1.3 @@ -7,7 +7,7 @@
     1.4  
     1.5  ifdef use_libovr
     1.6  	mod_cflags += -DUSE_LIBOVR
     1.7 -	mod_libs += -lovr
     1.8 +	mod_libs += -lOVR
     1.9  endif
    1.10  ifdef use_openhmd
    1.11  	mod_cflags += -DUSE_OPENHMD
     2.1 --- a/example/Makefile	Mon Mar 30 05:51:22 2015 +0300
     2.2 +++ b/example/Makefile	Mon Apr 06 05:17:11 2015 +0300
     2.3 @@ -2,13 +2,13 @@
     2.4  obj = $(src:.c=.o)
     2.5  bin = test
     2.6  
     2.7 -vrlib_root = ..
     2.8 +vrlib_root = $(shell pwd)/..
     2.9  vrlib = $(vrlib_root)/libgoatvr.so
    2.10  
    2.11  warn = -Wall
    2.12  
    2.13  CFLAGS = -pedantic $(warn) -g `pkg-config --cflags sdl2` -I$(vrlib_root)/src
    2.14 -LDFLAGS = $(libgl) `pkg-config --libs sdl2` -L$(vrlib_root) -lgoatvr -Wl,-rpath -Wl,$(vrlib_root)/
    2.15 +LDFLAGS = $(libgl) -L$(vrlib_root) -Wl,-rpath=$(vrlib_root) -lgoatvr `pkg-config --libs sdl2` 
    2.16  
    2.17  ifeq ($(shell uname -s), Darwin)
    2.18  	libgl = -framework OpenGL -lGLEW
     3.1 --- a/example/src/main.c	Mon Mar 30 05:51:22 2015 +0300
     3.2 +++ b/example/src/main.c	Mon Apr 06 05:17:11 2015 +0300
     3.3 @@ -129,10 +129,12 @@
     3.4  		SDL_GetWindowPosition(win, &prev_x, &prev_y);
     3.5  		SDL_SetWindowPosition(win, vr_geti(VR_WIN_XOFFS), vr_geti(VR_WIN_YOFFS));
     3.6  		SDL_SetWindowFullscreen(win, SDL_WINDOW_FULLSCREEN_DESKTOP);
     3.7 +		SDL_SetRelativeMouseMode(1);
     3.8  	} else {
     3.9  		/* return to windowed mode and move the window back to its original position */
    3.10  		SDL_SetWindowFullscreen(win, 0);
    3.11  		SDL_SetWindowPosition(win, prev_x, prev_y);
    3.12 +		SDL_SetRelativeMouseMode(0);
    3.13  	}
    3.14  }
    3.15  
     4.1 --- a/src/vr_libovr.c	Mon Mar 30 05:51:22 2015 +0300
     4.2 +++ b/src/vr_libovr.c	Mon Apr 06 05:17:11 2015 +0300
     4.3 @@ -23,7 +23,7 @@
     4.4  #endif
     4.5  
     4.6  /* undef this if you want the retarded health and safety warning screen */
     4.7 -#define DISABLE_RETARDED_HEALTH_WARNING
     4.8 +#undef DISABLE_RETARDED_HEALTH_WARNING
     4.9  
    4.10  /* just dropping the prototype here to avoid including CAPI_HSWDisplay.h */
    4.11  OVR_EXPORT void ovrhmd_EnableHSWDisplaySDKRender(ovrHmd hmd, ovrBool enabled);
    4.12 @@ -48,7 +48,7 @@
    4.13  	int use_fake = 0;
    4.14  	ovrTrackingCaps tracking;
    4.15  
    4.16 -	if(!ovr_Initialize()) {
    4.17 +	if(!ovr_Initialize(0)) {
    4.18  		return -1;
    4.19  	}
    4.20  	printf("initialized LibOVR %s\n", ovr_GetVersionString());
    4.21 @@ -149,8 +149,7 @@
    4.22  	}
    4.23  	ovrHmd_SetEnabledCaps(hmd, ovrHmdCap_LowPersistence | ovrHmdCap_DynamicPrediction);
    4.24  
    4.25 -	dcaps = ovrDistortionCap_Chromatic | ovrDistortionCap_TimeWarp |
    4.26 -		ovrDistortionCap_Overdrive | ovrDistortionCap_NoRestore;
    4.27 +	dcaps = ovrDistortionCap_TimeWarp |	ovrDistortionCap_Overdrive;
    4.28  #ifdef OVR_OS_LINUX
    4.29  	dcaps |= ovrDistortionCap_LinuxDevFullscreen;
    4.30  #endif
    4.31 @@ -323,7 +322,7 @@
    4.32  	inside_begin_end = 0;
    4.33  
    4.34  	if(cur_prog) {
    4.35 -		glUseProgram(0);
    4.36 +		/*glUseProgram(0);*/
    4.37  	}
    4.38  
    4.39  	return 1;