Stereo Viewport API

Detailed Description

You can create as many stereo viewports as you need. In other words, your application has a 1-to-many relationship with stereo viewports. Each viewport has its own frustum, which the SDK creates for you.

List of Functions

ZSError  zsCreateViewport (ZSContext context, ZSHandle* viewportHandle)
ZSError  zsDestroyViewport (ZSHandle viewportHandle)
ZSError  zsSetViewportPosition (ZSHandle viewportHandle, ZSInt32 x, ZSInt32 y)
ZSError  zsGetViewportPosition (ZSHandle viewportHandle, ZSInt32* x, ZSInt32* y)
ZSError  zsSetViewportSize (ZSHandle viewportHandle, ZSInt32 width, ZSInt32 height)
ZSError  zsGetViewportSize (ZSHandle viewportHandle, ZSInt32* width, ZSInt32* height)

Function Descriptions

ZSError zsCreateViewport ( ZSContext  context,
ZSHandle*   viewportHandle 
)

Creates a stereo viewport.

Remarks:
The stereo viewport is abstract and not an actual window that is created and registered through the OS. It manages a stereo frustum, which is responsible for various stereoscopic 3D calculations such as calculating the view and projection matrices for each eye.
Parameters:
[in] context A handle to the internal state of the zSpace SDK.
[out] viewportHandle A handle to the viewport.
ZSError zsDestroyViewport ( ZSHandle  viewportHandle )

Destroys a stereo viewport.

Note:
Calling zsShutdown() will free any viewports that have not been explicitly destroyed by calling zsDestroyViewport().
Parameters:
[in] viewportHandle A handle to the viewport.
ZSError zsGetViewportPosition ( ZSHandle  viewportHandle,
ZSInt32*   x,
ZSInt32*   y 
)

Gets the viewport's absolute virtual desktop coordinates (top-left corner).

Parameters:
[in] viewportHandle A handle to the viewport.
[out] x The x coordinate for the upper left corner of the viewport.
[out] y The y coordinate for the upper left corner of the viewport.
ZSError zsGetViewportSize ( ZSHandle  viewportHandle,
ZSInt32*   width,
ZSInt32*   height 
)

Gets the viewport's size in pixels.

Parameters:
[in] viewportHandle A handle to the viewport.
[out] width The width of the viewport in pixels.
[out] height The height of the viewport in pixels.
ZSError zsSetViewportPosition ( ZSHandle  viewportHandle,
ZSInt32  x,
ZSInt32  y 
)

Sets the viewport's absolute virtual desktop coordinates (top-left corner).

Parameters:
[in] viewportHandle A handle to the viewport.
[in] x The x coordinate for the upper left corner of the viewport.
[in] y The y coordinate for the upper left corner of the viewport.
ZSError zsSetViewportSize ( ZSHandle  viewportHandle,
ZSInt32  width,
ZSInt32  height 
)

Sets the viewport's size in pixels.

Parameters:
[in] viewportHandle A handle to the viewport.
[in] width The width of the viewport in pixels.
[in] height The height of the viewport in pixels.