Classes | |
struct | FrameRenderContext |
A frame's render context. More... | |
Public Types | |
enum | Feature : unsigned int { LowPersistence = ovrHmdCap_LowPersistence, LatencyTesting = ovrHmdCap_LatencyTest, DynamicPrediction = ovrHmdCap_DynamicPrediction, OrientationTracking = ovrSensorCap_Orientation, YawCorrection = ovrSensorCap_YawCorrection, PositionalTracking = ovrSensorCap_Position, ChromaticAberrationCorrection = ovrDistortionCap_Chromatic, Timewarp = ovrDistortionCap_TimeWarp, Vignette = ovrDistortionCap_Vignette } |
enum | Vision { Monocular, Binocular } |
enum | LOD { Lowest, Low, Medium, High, Highest } |
Public Slots | |
void | toggleVision () |
Toggle vision modes. | |
void | reduceLOD () |
Reduce the interface's level of detail. | |
void | increaseLOD () |
Increase the interface's level of detail. | |
void | toggleDynamicLOD () |
Toggle dynamic LOD. | |
void | toggleMultisampling () |
Toggle multisampling. | |
Signals | |
void | initialized () |
void | LODChanged (const OVRWindow::LOD ¤tLOD) |
Public Member Functions | |
OVRWindow (const unsigned int &index, const std::initializer_list< OVRWindow::Feature > &features) | |
Instantiate an OVRWindow object that is attached to an Oculus Rift device. More... | |
OVRWindow () | |
Instantiate an OVRWindow object that is attached to an Oculus Rift device. More... | |
virtual | ~OVRWindow () |
The destructor. | |
bool | hasValidGL () const |
Returns true if the OVRWindow has a valid OpenGL context, false otherwise. | |
QOpenGLContext & | getGL () |
Return the OVRWindow's OpenGL context. | |
const ovrHmdDesc & | getDeviceInfo () const |
Return the Oculus Rift's information. | |
const QSet< OVRWindow::Feature > & | getEnabledFeatures () const |
Return a set of all enabled features. | |
void | enableFeature (const OVRWindow::Feature &feature, const bool enable=true) |
void | enableFeatures (const std::initializer_list< OVRWindow::Feature > &features, const bool enable=true) |
bool | isFeatureEnabled (const OVRWindow::Feature &feature) const |
bool | isFeatureSupported (const OVRWindow::Feature &feature) const |
const OVRWindow::Vision & | getVision () const |
void | setVision (const OVRWindow::Vision &vision) |
const OVRWindow::LOD & | getLOD () const |
void | setLOD (const OVRWindow::LOD &lod) |
void | enableDynamicLOD (const bool enable=true) |
float | getIPD () const |
void | setIPD (const float &ipd) |
void | forceZeroIPD (const bool &force) |
const float & | getPixelDensity () const |
void | setPixelDensity (const float &density) |
const float & | getNearClippingDistance () const |
void | setNearClippingDistance (const float &near) |
const float & | getFarClippingDistance () const |
void | setFarClippingDistance (const float &far) |
bool | isMultisamplingEnabled () const |
void | enableMultisampling (const bool enable=true) |
Protected Member Functions | |
virtual void | initializeGL () |
Initialize OpenGL. | |
virtual void | paintGL (const OVRWindow::FrameRenderContext &context, const float &dt) |
This virtual function is called whenever a new frame needs to be rendered. | |
virtual void | resizeGL (const unsigned int &width, const unsigned int &height) |
This virtual function is called whenever the window is resized. More... | |
void | makeCurrent () |
void | doneCurrent () |
virtual void | changeLOD (const OVRWindow::LOD &lod) |
This virtual function is called whenever the level of detail (LOD) is changed. More... | |
|
strong |
TODO Explain me better.
An enumeration of features that can be toggled. Be careful when disabling certain features as it may induce simulator sickness.
|
strong |
TODO Explain me.
|
strong |
TODO Explain me.
OVRWindow::OVRWindow | ( | const unsigned int & | index, |
const std::initializer_list< OVRWindow::Feature > & | features | ||
) |
Instantiate an OVRWindow object that is attached to an Oculus Rift device.
The instantiated object is attached to a device with the specified index, and has has a set of enabled features. If no hardware device is detected, a debug device that emulates some of the DK1's features is used.
index | a positive integer used to access an Oculus Rift device. |
features | a set of device features to enable. |
OVRWindow::OVRWindow | ( | ) |
Instantiate an OVRWindow object that is attached to an Oculus Rift device.
The instantiated object is attached to a device with the index '0', and has all device features enabled. If no hardware device is detected, a debug device that emulates some of the DK1's features is used.
|
protectedvirtual |
This virtual function is called whenever the level of detail (LOD) is changed.
lod | the new level of detail. |
|
protected |
Makes no GL context the current context. This may be useful in multi-threaded environments.
void OVRWindow::enableDynamicLOD | ( | const bool | enable = true | ) |
Enable or disable dynamic level of detail (LOD). Dynamic LOD adjusts the level of detail to make sure the frame rate either matches, or is better than the device's refresh rate.
enable | true to enable dynamic LOD, false to disable. |
void OVRWindow::enableFeature | ( | const OVRWindow::Feature & | feature, |
const bool | enable = true |
||
) |
Enable or disable a feature.
feature | the feature to enable or disable. |
enable | true to enable the feature, false to disable it. |
void OVRWindow::enableFeatures | ( | const std::initializer_list< OVRWindow::Feature > & | features, |
const bool | enable = true |
||
) |
Enable or disable a set of features.
features | the features to enable or disable. |
enable | true to enable the features, false to disable them. |
void OVRWindow::enableMultisampling | ( | const bool | enable = true | ) |
Enable or disable multisampling.
enable | true to enable multisampling, false to disable. |
void OVRWindow::forceZeroIPD | ( | const bool & | force | ) |
TODO Explain me.
const float & OVRWindow::getFarClippingDistance | ( | ) | const |
Return the viewing frustum's far clipping plane distance.
float OVRWindow::getIPD | ( | ) | const |
Return the current interpupillary distance (IPD) in millimeters.
const OVRWindow::LOD & OVRWindow::getLOD | ( | ) | const |
Return the current level of detail.
const float & OVRWindow::getNearClippingDistance | ( | ) | const |
Return the viewing frustum's near clipping plane distance.
const float & OVRWindow::getPixelDensity | ( | ) | const |
TODO Explain me.
const OVRWindow::Vision & OVRWindow::getVision | ( | ) | const |
Return the current vision mode.
|
signal |
This signal is emitted when the interface has been correctly initialized and is ready for use.
bool OVRWindow::isFeatureEnabled | ( | const OVRWindow::Feature & | feature | ) | const |
Returns true if the specified feature is enabled, false otherwise.
feature | the feature to query. |
bool OVRWindow::isFeatureSupported | ( | const OVRWindow::Feature & | feature | ) | const |
Returns true if the specified feature is supported by the device, false otherwise.
feature | the feature to query. |
bool OVRWindow::isMultisamplingEnabled | ( | ) | const |
Returns true if multisampling is enabled, false otherwise.
|
signal |
This signal is emitted when the interface's level of detail (LOD) has been changed.
currentLOD | the interface's current level of detail. |
|
protected |
Make the window's rendering context the current OpenGL context.
|
protectedvirtual |
This virtual function is called whenever the window is resized.
width | the window's new width. |
height | the window's new height. |
void OVRWindow::setFarClippingDistance | ( | const float & | far | ) |
Set the viewing frustum's far clipping plane distance.
far | the far clipping plane's distance. |
void OVRWindow::setIPD | ( | const float & | ipd | ) |
Set the interpupillary distance (IPD) in millimeters.
ipd | the distance to set. |
void OVRWindow::setLOD | ( | const OVRWindow::LOD & | lod | ) |
Set the current level of detail (LOD). The LOD determines which features are enabled or disabled with the goal of reducing frame render time, thereby increasing performance. Note that unless dynamic LOD is disabled, the LOD set by this member function will change.
lod | the level of detail to set. |
void OVRWindow::setNearClippingDistance | ( | const float & | near | ) |
Set the viewing frustum's near clipping plane distance.
near | the near clipping plane's distance. |
void OVRWindow::setPixelDensity | ( | const float & | density | ) |
TODO Explain me.
void OVRWindow::setVision | ( | const OVRWindow::Vision & | vision | ) |
Set the vision.
vision | the vision to set. |