Open topic with navigation

# Stereo Buffer API

## Detailed Description

The Stereo Buffer API handles left/right frame detection. Use zsCreateStereoBuffer() to create the buffer. Call zsBeginStereoBufferFrame() at the beginning of the frame on the rendering thread.

## List of Functions
ZSError | zsCreateStereoBuffer (ZSContext context, ZSRenderer renderer, void* reserved, ZSHandle* bufferHandle)
ZSError | zsDestroyStereoBuffer (ZSHandle bufferHandle)
ZSError | zsSetStereoBufferFullScreen (ZSHandle bufferHandle, ZSBool isFullScreen)
ZSError | zsBeginStereoBufferFrame (ZSHandle bufferHandle)
ZSError | zsSyncStereoBuffer (ZSHandle bufferHandle)
## List of Enumerations
enum | ZSRenderer { ZS_RENDERER_QUAD_BUFFER_GL = 0, ZS_RENDERER_QUAD_BUFFER_D3D9 = 1, ZS_RENDERER_QUAD_BUFFER_D3D10 = 2, ZS_RENDERER_QUAD_BUFFER_D3D11 = 3, ZS_RENDERER_QUAD_BUFFER_D3D11_1 = 4 }

## Function Descriptions

ZSError zsBeginStereoBufferFrame | ( | ZSHandle | bufferHandle | ) |

Signals the beginning of the frame. Handles the initial synchronization and any pending synchronization requests for left/right frame detection. This must be called on the application's rendering thread.

Parameters:

  [in] | bufferHandle | A handle to the buffer.

ZSError zsCreateStereoBuffer | ( | ZSContext | context,
|  | ZSRenderer | renderer,
|  | void* | reserved,
|  | ZSHandle* | bufferHandle
| ) |  |

Creates a stereo buffer for left/right frame detection.

Parameters:

  [in] | context | A handle to the internal state of the zSpace SDK.
  [in] | renderer | The application's graphics API.
  [in] | reserved | A reserved argument depending on the ZSRenderer: ZS_RENDERER_QUAD_BUFFER_GL - NULL ZS_RENDERER_QUAD_BUFFER_D3D9 - Pass in IDirect3DDevice9* ZS_RENDERER_QUAD_BUFFER_D3D10 - Pass in IDXGISwapChain* ZS_RENDERER_QUAD_BUFFER_D3D11 - Pass in IDXGISwapChain* ZS_RENDERER_QUAD_BUFFER_D3D11_1 - Pass in IDXGISwapChain1*
  [out] | bufferHandle | A handle for the buffer.

ZSError zsDestroyStereoBuffer | ( | ZSHandle | bufferHandle | ) |

Destroys the stereo buffer.

Note:
  Calling zsShutdown() will free any stereo buffers that have not been explicitly destroyed by calling zsDestroyStereoBuffer().

Parameters:

  [in] | bufferHandle | A handle to the buffer.

ZSError zsSetStereoBufferFullScreen | ( | ZSHandle | bufferHandle,
|  | ZSBool | isFullScreen
| ) |  |

Sets the stereo buffer to full screen or windowed mode.

Parameters:

  [in] | bufferHandle | A handle to the buffer.
  [in] | isFullScreen | True for full screen mode, false otherwise.

ZSError zsSyncStereoBuffer | ( | ZSHandle | bufferHandle | ) |

Synchronizes the left and right frames. Call this function to force a left/right frame synchronization.

Parameters:

  [in] | bufferHandle | A handle to the buffer.

## Enumeration Descriptions

enum ZSRenderer

Defines the renderer used by the Stereo Buffer API.

Enumerator:

  ZS_RENDERER_QUAD_BUFFER_GL |
  ZS_RENDERER_QUAD_BUFFER_D3D9 |
  ZS_RENDERER_QUAD_BUFFER_D3D10 |
  ZS_RENDERER_QUAD_BUFFER_D3D11 |
  ZS_RENDERER_QUAD_BUFFER_D3D11_1 |

Open topic with navigation