2 * \file stereo_display.cpp
3 * \brief IStereoDisplay
4 * \date 2013-06-27 16:29GMT
5 * \author Jan Boon (Kaetemi)
9 // NeL - MMORPG Framework <https://wiki.ryzom.dev/>
10 // Copyright (C) 2013-2014 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
12 // This source file has been modified by the following contributors:
13 // Copyright (C) 2013 Thibaut GIRKA (ThibG) <thib@sitedethib.com>
15 // This program is free software: you can redistribute it and/or modify
16 // it under the terms of the GNU Affero General Public License as
17 // published by the Free Software Foundation, either version 3 of the
18 // License, or (at your option) any later version.
20 // This program is distributed in the hope that it will be useful,
21 // but WITHOUT ANY WARRANTY; without even the implied warranty of
22 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 // GNU Affero General Public License for more details.
25 // You should have received a copy of the GNU Affero General Public License
26 // along with this program. If not, see <http://www.gnu.org/licenses/>.
29 #include "nel/3d/stereo_display.h"
34 // #include <nel/misc/debug.h>
37 #include "nel/3d/stereo_ovr.h"
38 #include "nel/3d/stereo_ovr_04.h"
39 #include "nel/3d/stereo_libvr.h"
40 #include "nel/3d/stereo_debugger.h"
43 // using namespace NLMISC;
51 IStereoDisplay::IStereoDisplay()
56 IStereoDisplay::~IStereoDisplay()
61 const char *IStereoDisplay::getLibraryName(CStereoDeviceInfo::TStereoDeviceLibrary library
)
63 static const char *nel3dName
= "NeL 3D";
64 static const char *ovrName
= "Oculus SDK";
65 static const char *libvrName
= "LibVR";
66 static const char *openhmdName
= "OpenHMD";
69 case CStereoDeviceInfo::NeL3D
:
71 case CStereoDeviceInfo::OVR
:
73 case CStereoDeviceInfo::LibVR
:
75 case CStereoDeviceInfo::OpenHMD
:
78 nlerror("Invalid device library specified");
79 return "<InvalidDeviceLibrary>";
82 void IStereoDisplay::listDevices(std::vector
<CStereoDeviceInfo
> &devicesOut
)
85 CStereoOVR::listDevices(devicesOut
);
88 CStereoLibVR::listDevices(devicesOut
);
91 CStereoDebugger::listDevices(devicesOut
);
95 IStereoDisplay
*IStereoDisplay::createDevice(const CStereoDeviceInfo
&deviceInfo
)
97 return deviceInfo
.Factory
->createDevice();
100 void IStereoDisplay::releaseUnusedLibraries()
103 if (!CStereoOVR::isLibraryInUse())
104 CStereoOVR::releaseLibrary();
108 void IStereoDisplay::releaseAllLibraries()
111 CStereoOVR::releaseLibrary();
115 } /* namespace NL3D */