LibOVR is optional, and is disabled by default

This commit is contained in:
Michael Witrant 2013-07-06 20:05:19 +02:00
parent ed8e0edfd0
commit 69c194f57f
5 changed files with 20 additions and 1 deletions

View file

@ -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)

View file

@ -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)

View file

@ -43,6 +43,9 @@
#ifndef NL3D_STEREO_OVR_H
#define NL3D_STEREO_OVR_H
#ifdef WITH_LIBOVR
#include <nel/misc/types_nl.h>
// STL includes
@ -166,6 +169,8 @@ private:
} /* namespace NL3D */
#endif /* WITH_LIBOVR */
#endif /* #ifndef NL3D_STEREO_OVR_H */
/* end of file */

View file

@ -75,7 +75,9 @@ const char *IStereoDisplay::getLibraryName(CStereoDeviceInfo::TStereoDeviceLibra
void IStereoDisplay::listDevices(std::vector<CStereoDeviceInfo> &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 */

View file

@ -41,6 +41,8 @@
* so, delete this exception statement from your version.
*/
#ifdef WITH_LIBOVR
#include <nel/misc/types_nl.h>
#include <nel/3d/stereo_ovr.h>
@ -736,4 +738,6 @@ bool CStereoOVR::isDeviceCreated()
} /* namespace NL3D */
#endif /* WITH_LIBOVR */
/* end of file */