OSVR Framework (Internal Development Docs)  0.6-1962-g59773924
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
DisplayC.cpp File Reference

Implementation. More...

Go to the source code of this file.

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. The corresponding context must still be open. 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. (This does not include other video inputs that may be on a single virtual desktop, etc. or explicitly account for display configurations that use multiple video inputs. It does not necessarily indicate that a viewport in the sense of glViewport must be created with these parameters, though the parameter order matches for convenience.) 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. (double version) 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. (float version) 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

Definition in file DisplayC.cpp.

Macro Definition Documentation

#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 "!"); \
} \
#define OSVR_RETURN_FAILURE
The "failure" value for an OSVR_ReturnCode.
Definition: ReturnCodesC.h:47
#define OSVR_UTIL_MULTILINE_END
Macro for the end of a multi-line macro expansion.
Definition: MacroToolsC.h:59

Definition at line 56 of file DisplayC.cpp.

#define OSVR_VALIDATE_DISPLAY_CONFIG
Value:
OSVR_UTIL_MULTILINE_BEGIN \
if (nullptr == disp) { \
OSVR_DEV_VERBOSE("Passed a null display config!"); \
} \
#define OSVR_RETURN_FAILURE
The "failure" value for an OSVR_ReturnCode.
Definition: ReturnCodesC.h:47
#define OSVR_UTIL_MULTILINE_END
Macro for the end of a multi-line macro expansion.
Definition: MacroToolsC.h:59

Definition at line 97 of file DisplayC.cpp.

#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())

Definition at line 109 of file DisplayC.cpp.

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

Definition at line 112 of file DisplayC.cpp.

#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

Definition at line 117 of file DisplayC.cpp.

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

Definition at line 120 of file DisplayC.cpp.