OSVR-Core
Classes | Macros | Functions
DisplayC.cpp File Reference

Implementation. More...

#include <osvr/ClientKit/DisplayC.h>
#include <osvr/ClientKit/InterfaceC.h>
#include <osvr/Util/Verbosity.h>
#include <osvr/Common/ClientContext.h>
#include <osvr/Client/DisplayConfig.h>
#include <osvr/Util/MacroToolsC.h>
#include <osvr/Util/EigenExtras.h>
#include <osvr/Util/EigenInterop.h>
#include <osvr/Util/MatrixConventions.h>
#include <osvr/Util/MatrixEigenAssign.h>
#include <boost/assert.hpp>
#include <utility>

Classes

struct  OSVR_DisplayConfigObject
 

Macros

#define OSVR_VALIDATE_OUTPUT_PTR(X, DESC)
 
#define OSVR_VALIDATE_DISPLAY_CONFIG
 
#define OSVR_VALIDATE_VIEWER_ID   BOOST_ASSERT_MSG(viewer == 0, "Must pass a valid viewer ID.")
 
#define OSVR_VALIDATE_EYE_ID
 
#define OSVR_VALIDATE_SURFACE_ID   BOOST_ASSERT_MSG(surface == 0, "Must pass a valid surface ID.")
 
#define OSVR_VALIDATE_DISPLAY_INPUT_ID
 

Functions

OSVR_ReturnCode osvrClientGetDisplay (OSVR_ClientContext ctx, OSVR_DisplayConfig *disp)
 Allocates a display configuration object populated with data from the OSVR system. More...
 
OSVR_ReturnCode osvrClientFreeDisplay (OSVR_DisplayConfig disp)
 Frees a display configuration object. More...
 
OSVR_ReturnCode osvrClientCheckDisplayStartup (OSVR_DisplayConfig disp)
 Checks to see if a display is fully configured and ready, including having received its first pose update. More...
 
OSVR_ReturnCode osvrClientGetNumDisplayInputs (OSVR_DisplayConfig disp, OSVR_DisplayInputCount *numDisplayInputs)
 A display config can have one or more display inputs to pass pixels over (HDMI/DVI connections, etc): retrieve the number of display inputs in the current configuration. More...
 
OSVR_ReturnCode osvrClientGetDisplayDimensions (OSVR_DisplayConfig disp, OSVR_DisplayInputCount displayInputIndex, OSVR_DisplayDimension *width, OSVR_DisplayDimension *height)
 Retrieve the pixel dimensions of a given display input for a display config. More...
 
OSVR_ReturnCode osvrClientGetNumViewers (OSVR_DisplayConfig disp, OSVR_ViewerCount *viewers)
 A display config can have one (or theoretically more) viewers: retrieve the viewer count. More...
 
OSVR_ReturnCode osvrClientGetViewerPose (OSVR_DisplayConfig disp, OSVR_ViewerCount viewer, OSVR_Pose3 *pose)
 Get the pose of a viewer in a display config. More...
 
OSVR_ReturnCode osvrClientGetNumEyesForViewer (OSVR_DisplayConfig disp, OSVR_ViewerCount viewer, OSVR_EyeCount *eyes)
 Each viewer in a display config can have one or more "eyes" which have a substantially similar pose: get the count. More...
 
OSVR_ReturnCode osvrClientGetViewerEyePose (OSVR_DisplayConfig disp, OSVR_ViewerCount viewer, OSVR_EyeCount eye, OSVR_Pose3 *pose)
 Get the "viewpoint" for the given eye of a viewer in a display config. More...
 
OSVR_ReturnCode osvrClientGetViewerEyeViewMatrixd (OSVR_DisplayConfig disp, OSVR_ViewerCount viewer, OSVR_EyeCount eye, OSVR_MatrixConventions flags, double *mat)
 Get the view matrix (inverse of pose) for the given eye of a viewer in a display config - matrix of doubles. More...
 
OSVR_ReturnCode osvrClientGetViewerEyeViewMatrixf (OSVR_DisplayConfig disp, OSVR_ViewerCount viewer, OSVR_EyeCount eye, OSVR_MatrixConventions flags, float *mat)
 Get the view matrix (inverse of pose) for the given eye of a viewer in a display config - matrix of floats. More...
 
OSVR_ReturnCode osvrClientGetNumSurfacesForViewerEye (OSVR_DisplayConfig disp, OSVR_ViewerCount viewer, OSVR_EyeCount eye, OSVR_SurfaceCount *surfaces)
 Each eye of each viewer in a display config has one or more surfaces (aka "screens") on which content should be rendered. More...
 
OSVR_ReturnCode osvrClientGetRelativeViewportForViewerEyeSurface (OSVR_DisplayConfig disp, OSVR_ViewerCount viewer, OSVR_EyeCount eye, OSVR_SurfaceCount surface, OSVR_ViewportDimension *left, OSVR_ViewportDimension *bottom, OSVR_ViewportDimension *width, OSVR_ViewportDimension *height)
 Get the dimensions/location of the viewport within the display input for a surface seen by an eye of a viewer in a display config. More...
 
OSVR_ReturnCode osvrClientGetViewerEyeSurfaceDisplayInputIndex (OSVR_DisplayConfig disp, OSVR_ViewerCount viewer, OSVR_EyeCount eye, OSVR_SurfaceCount surface, OSVR_DisplayInputCount *displayInput)
 Get the index of the display input for a surface seen by an eye of a viewer in a display config. More...
 
OSVR_ReturnCode osvrClientGetViewerEyeSurfaceProjectionMatrixd (OSVR_DisplayConfig disp, OSVR_ViewerCount viewer, OSVR_EyeCount eye, OSVR_SurfaceCount surface, double near, double far, OSVR_MatrixConventions flags, double *matrix)
 Get the projection matrix for a surface seen by an eye of a viewer in a display config. More...
 
OSVR_ReturnCode osvrClientGetViewerEyeSurfaceProjectionMatrixf (OSVR_DisplayConfig disp, OSVR_ViewerCount viewer, OSVR_EyeCount eye, OSVR_SurfaceCount surface, float near, float far, OSVR_MatrixConventions flags, float *matrix)
 Get the projection matrix for a surface seen by an eye of a viewer in a display config. More...
 
OSVR_ReturnCode osvrClientGetViewerEyeSurfaceProjectionClippingPlanes (OSVR_DisplayConfig disp, OSVR_ViewerCount viewer, OSVR_EyeCount eye, OSVR_SurfaceCount surface, double *left, double *right, double *bottom, double *top)
 Get the clipping planes (positions at unit distance) for a surface seen by an eye of a viewer in a display config. More...
 
OSVR_ReturnCode osvrClientDoesViewerEyeSurfaceWantDistortion (OSVR_DisplayConfig disp, OSVR_ViewerCount viewer, OSVR_EyeCount eye, OSVR_SurfaceCount surface, OSVR_CBool *distortionRequested)
 Determines if a surface seen by an eye of a viewer in a display config requests some distortion to be performed. More...
 
OSVR_ReturnCode osvrClientGetViewerEyeSurfaceRadialDistortionPriority (OSVR_DisplayConfig disp, OSVR_ViewerCount viewer, OSVR_EyeCount eye, OSVR_SurfaceCount surface, OSVR_DistortionPriority *priority)
 Returns the priority/availability of radial distortion parameters for a surface seen by an eye of a viewer in a display config. More...
 
OSVR_ReturnCode osvrClientGetViewerEyeSurfaceRadialDistortion (OSVR_DisplayConfig disp, OSVR_ViewerCount viewer, OSVR_EyeCount eye, OSVR_SurfaceCount surface, OSVR_RadialDistortionParameters *params)
 Returns the radial distortion parameters, if known/requested, for a surface seen by an eye of a viewer in a display config. More...
 

Detailed Description

Implementation.

Date
2015
Author
Sensics, Inc. http://sensics.com/osvr

Macro Definition Documentation

§ OSVR_VALIDATE_DISPLAY_CONFIG

#define OSVR_VALIDATE_DISPLAY_CONFIG
Value:
OSVR_UTIL_MULTILINE_BEGIN \
if (nullptr == disp) { \
OSVR_DEV_VERBOSE("Passed a null display config!"); \
} \
OSVR_UTIL_MULTILINE_END
#define OSVR_RETURN_FAILURE
The "failure" value for an OSVR_ReturnCode.
Definition: ReturnCodesC.h:47

§ OSVR_VALIDATE_DISPLAY_INPUT_ID

#define OSVR_VALIDATE_DISPLAY_INPUT_ID
Value:
BOOST_ASSERT_MSG(displayInputIndex < disp->cfg->getNumDisplayInputs(), \
"Must pass a valid display input index.")

§ OSVR_VALIDATE_EYE_ID

#define OSVR_VALIDATE_EYE_ID
Value:
BOOST_ASSERT_MSG(eye < disp->cfg->getNumViewerEyes(viewer), \
"Must pass a valid eye ID.")

§ OSVR_VALIDATE_OUTPUT_PTR

#define OSVR_VALIDATE_OUTPUT_PTR (   X,
  DESC 
)
Value:
OSVR_UTIL_MULTILINE_BEGIN \
if (nullptr == X) { \
OSVR_DEV_VERBOSE("Passed a null pointer for output parameter " #X \
", " DESC "!"); \
} \
OSVR_UTIL_MULTILINE_END
#define OSVR_RETURN_FAILURE
The "failure" value for an OSVR_ReturnCode.
Definition: ReturnCodesC.h:47

§ OSVR_VALIDATE_SURFACE_ID

#define OSVR_VALIDATE_SURFACE_ID   BOOST_ASSERT_MSG(surface == 0, "Must pass a valid surface ID.")
Todo:
actually check the config for number of surfaces

§ OSVR_VALIDATE_VIEWER_ID

#define OSVR_VALIDATE_VIEWER_ID   BOOST_ASSERT_MSG(viewer == 0, "Must pass a valid viewer ID.")
Todo:
make these an "always" check? instead of an assert
Todo:
actually check the config for number of viewers (viewer < disp->cfg->size())