/**
* \file stereo_display.cpp
* \brief IStereoDisplay
* \date 2013-06-27 16:29GMT
* \author Jan Boon (Kaetemi)
* IStereoDisplay
*/
/*
* Copyright (C) 2013 by authors
*
* This file is part of NL3D.
* NL3D is free software: you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* NL3D is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General
* Public License for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with NL3D. If not, see
* .
*/
#include
#include
// STL includes
// NeL includes
// #include
// Project includes
#include
#include
#include
using namespace std;
// using namespace NLMISC;
namespace NL3D {
IStereoDisplay::IStereoDisplay()
{
}
IStereoDisplay::~IStereoDisplay()
{
}
const char *IStereoDisplay::getLibraryName(CStereoDeviceInfo::TStereoDeviceLibrary library)
{
static const char *nel3dName = "NeL 3D";
static const char *ovrName = "Oculus SDK";
static const char *libvrName = "LibVR";
static const char *openhmdName = "OpenHMD";
switch (library)
{
case CStereoDeviceInfo::NeL3D:
return nel3dName;
case CStereoDeviceInfo::OVR:
return ovrName;
case CStereoDeviceInfo::LibVR:
return libvrName;
case CStereoDeviceInfo::OpenHMD:
return openhmdName;
}
nlerror("Invalid device library specified");
return "";
}
void IStereoDisplay::listDevices(std::vector &devicesOut)
{
#ifdef HAVE_LIBOVR
CStereoOVR::listDevices(devicesOut);
#endif
#ifdef HAVE_LIBVR
CStereoLibVR::listDevices(devicesOut);
#endif
#if !FINAL_VERSION
CStereoDebugger::listDevices(devicesOut);
#endif
}
IStereoDisplay *IStereoDisplay::createDevice(const CStereoDeviceInfo &deviceInfo)
{
return deviceInfo.Factory->createDevice();
}
void IStereoDisplay::releaseUnusedLibraries()
{
#ifdef HAVE_LIBOVR
if (!CStereoOVR::isLibraryInUse())
CStereoOVR::releaseLibrary();
#endif
}
void IStereoDisplay::releaseAllLibraries()
{
#ifdef HAVE_LIBOVR
CStereoOVR::releaseLibrary();
#endif
}
} /* namespace NL3D */
/* end of file */