* VR stereo config functions for VR simulator */
| 9 | * VR stereo config functions for VR simulator |
| 10 | */ |
| 11 | class VrStereoConfig : public ::VrStereoConfig { |
| 12 | public: |
| 13 | VrStereoConfig(const ::VrDeviceInfo& info) { Load(info); } |
| 14 | |
| 15 | VrStereoConfig(const VrStereoConfig&) = delete; |
| 16 | VrStereoConfig& operator=(const VrStereoConfig&) = delete; |
| 17 | VrStereoConfig(VrStereoConfig&&) = default; |
| 18 | VrStereoConfig& operator=(VrStereoConfig&&) = default; |
| 19 | |
| 20 | /** |
| 21 | * Load VR stereo config for VR simulator device parameters |
| 22 | */ |
| 23 | void Load(const ::VrDeviceInfo& info) { set(LoadVrStereoConfig(info)); } |
| 24 | |
| 25 | /** |
| 26 | * Unload VR stereo config |
| 27 | */ |
| 28 | ~VrStereoConfig() { Unload(); } |
| 29 | |
| 30 | /** |
| 31 | * Begin stereo rendering |
| 32 | */ |
| 33 | VrStereoConfig& BeginMode() { |
| 34 | ::BeginVrStereoMode(*this); |
| 35 | return *this; |
| 36 | } |
| 37 | |
| 38 | /** |
| 39 | * End stereo rendering |
| 40 | */ |
| 41 | VrStereoConfig& EndMode() { |
| 42 | ::EndVrStereoMode(); |
| 43 | return *this; |
| 44 | } |
| 45 | |
| 46 | /** |
| 47 | * Unload VR stereo config |
| 48 | */ |
| 49 | void Unload() { ::UnloadVrStereoConfig(*this); } |
| 50 | protected: |
| 51 | void set(const ::VrStereoConfig& config) { |
| 52 | projection[0] = config.projection[0]; |
| 53 | projection[1] = config.projection[1]; |
| 54 | viewOffset[0] = config.viewOffset[0]; |
| 55 | viewOffset[1] = config.viewOffset[1]; |
| 56 | leftLensCenter[0] = config.leftLensCenter[0]; |
| 57 | leftLensCenter[1] = config.leftLensCenter[1]; |
| 58 | rightLensCenter[0] = config.rightLensCenter[0]; |
| 59 | rightLensCenter[1] = config.rightLensCenter[1]; |
| 60 | leftScreenCenter[0] = config.leftScreenCenter[0]; |
| 61 | leftScreenCenter[1] = config.leftScreenCenter[1]; |
| 62 | rightScreenCenter[0] = config.rightScreenCenter[0]; |
| 63 | rightScreenCenter[1] = config.rightScreenCenter[1]; |
| 64 | scale[0] = config.scale[0]; |
| 65 | scale[1] = config.scale[1]; |
| 66 | scaleIn[0] = config.scaleIn[0]; |
| 67 | scaleIn[1] = config.scaleIn[1]; |
| 68 | } |
nothing calls this directly
no outgoing calls
no test coverage detected