From a33a0e5c5650d9e9dcbd23a3eb56ff96129fa3ed Mon Sep 17 00:00:00 2001 From: Michael Witrant Date: Sat, 6 Jul 2013 20:05:19 +0200 Subject: [PATCH] LibOVR is optional, and is disabled by default --HG-- branch : multipass-stereo --- code/CMakeModules/nel.cmake | 2 ++ code/nel/CMakeLists.txt | 4 +++- code/nel/include/nel/3d/stereo_ovr.h | 5 +++++ code/nel/src/3d/stereo_display.cpp | 6 ++++++ code/nel/src/3d/stereo_ovr.cpp | 4 ++++ 5 files changed, 20 insertions(+), 1 deletion(-) diff --git a/code/CMakeModules/nel.cmake b/code/CMakeModules/nel.cmake index 4308d0b44..f3897cce0 100644 --- a/code/CMakeModules/nel.cmake +++ b/code/CMakeModules/nel.cmake @@ -324,6 +324,8 @@ MACRO(NL_SETUP_NEL_DEFAULT_OPTIONS) OPTION(WITH_NEL_MAXPLUGIN "Build NeL 3dsMax Plugin" OFF) OPTION(WITH_NEL_SAMPLES "Build NeL Samples" ON ) OPTION(WITH_NEL_TESTS "Build NeL Unit Tests" ON ) + + OPTION(WITH_LIBOVR "With LibOVR support" OFF) ENDMACRO(NL_SETUP_NEL_DEFAULT_OPTIONS) MACRO(NL_SETUP_NELNS_DEFAULT_OPTIONS) diff --git a/code/nel/CMakeLists.txt b/code/nel/CMakeLists.txt index 1ac54f332..07474abcd 100644 --- a/code/nel/CMakeLists.txt +++ b/code/nel/CMakeLists.txt @@ -41,7 +41,9 @@ IF(WITH_GTK) FIND_PACKAGE(GTK2) ENDIF(WITH_GTK) -FIND_PACKAGE(LibOVR) +IF(WITH_LIBOVR) + FIND_PACKAGE(LibOVR) +ENDIF(WITH_LIBOVR) IF(WITH_INSTALL_LIBRARIES) IF(UNIX) diff --git a/code/nel/include/nel/3d/stereo_ovr.h b/code/nel/include/nel/3d/stereo_ovr.h index 3b417b871..e8a67a45a 100644 --- a/code/nel/include/nel/3d/stereo_ovr.h +++ b/code/nel/include/nel/3d/stereo_ovr.h @@ -43,6 +43,9 @@ #ifndef NL3D_STEREO_OVR_H #define NL3D_STEREO_OVR_H + +#ifdef WITH_LIBOVR + #include // STL includes @@ -166,6 +169,8 @@ private: } /* namespace NL3D */ +#endif /* WITH_LIBOVR */ + #endif /* #ifndef NL3D_STEREO_OVR_H */ /* end of file */ diff --git a/code/nel/src/3d/stereo_display.cpp b/code/nel/src/3d/stereo_display.cpp index d2a8fd932..57f2722eb 100644 --- a/code/nel/src/3d/stereo_display.cpp +++ b/code/nel/src/3d/stereo_display.cpp @@ -75,7 +75,9 @@ const char *IStereoDisplay::getLibraryName(CStereoDeviceInfo::TStereoDeviceLibra void IStereoDisplay::listDevices(std::vector &devicesOut) { +#ifdef WITH_LIBOVR CStereoOVR::listDevices(devicesOut); +#endif #if !FINAL_VERSION CStereoDebugger::listDevices(devicesOut); #endif @@ -88,13 +90,17 @@ IStereoDisplay *IStereoDisplay::createDevice(const CStereoDeviceInfo &deviceInfo void IStereoDisplay::releaseUnusedLibraries() { +#ifdef WITH_LIBOVR if (!CStereoOVR::isLibraryInUse()) CStereoOVR::releaseLibrary(); +#endif } void IStereoDisplay::releaseAllLibraries() { +#ifdef WITH_LIBOVR CStereoOVR::releaseLibrary(); +#endif } } /* namespace NL3D */ diff --git a/code/nel/src/3d/stereo_ovr.cpp b/code/nel/src/3d/stereo_ovr.cpp index 2b91e1836..3c6fb88e2 100644 --- a/code/nel/src/3d/stereo_ovr.cpp +++ b/code/nel/src/3d/stereo_ovr.cpp @@ -41,6 +41,8 @@ * so, delete this exception statement from your version. */ +#ifdef WITH_LIBOVR + #include #include @@ -736,4 +738,6 @@ bool CStereoOVR::isDeviceCreated() } /* namespace NL3D */ +#endif /* WITH_LIBOVR */ + /* end of file */