This site has been archived and remains strictly as a historical reference for developers who actively maintain apps built using the legacy Google VR SDK, which was last updated in 2019 and is no longer receiving updates.
  • All developers actively developing experiences for Google Cardboard should use the new open source Cardboard SDKs for iOS, Android NDK, and Unity XR Plugin. These new SDKs offer streamlined APIs, improved device compatibility, and built-in viewer profile QR code scanning.
  • The Daydream View VR headset is no longer available for purchase as of October 15, 2019. Existing apps on supported devices are unaffected for users who previously installed those applications. It is no longer possible to opt-in to Daydream distribution via Google Play.

gvr::BufferSpec

#include <gvr.h>

Convenience C++ wrapper for gvr_buffer_spec, an opaque pixel buffer specification.

Summary

Frees the underlying gvr_buffer_spec on destruction.

Inheritance

Inherits from: gvr::WrapperBase< gvr_buffer_spec, gvr_buffer_spec_destroy >

Public functions

GetSamples() const
int32_t
Gets the number of samples per pixel in the buffer.
GetSize() const
Gets the buffer's size.
SetColorFormat(ColorFormat color_format)
void
Sets the color format for this buffer.
SetDepthStencilFormat(DepthStencilFormat depth_stencil_format)
void
Sets the depth and stencil format for this buffer.
SetMultiviewLayers(int32_t num_layers)
void
For more information, see gvr_buffer_spec_set_multiview_layers().
SetSamples(int32_t num_samples)
void
Sets the number of samples per pixel.
SetSize(const Sizei & size)
void
Sets the buffer's size.
SetSize(int32_t width, int32_t height)
void
Sets the buffer's size to the passed width and height.

Public functions

GetSamples

int32_t GetSamples() const 

Gets the number of samples per pixel in the buffer.

For more information, see gvr_buffer_spec_get_samples().

GetSize

Sizei GetSize() const 

Gets the buffer's size.

The default value is the recommended render target size. For more information, see gvr_buffer_spec_get_size().

SetColorFormat

void SetColorFormat(
  ColorFormat color_format
)

Sets the color format for this buffer.

For more information, see gvr_buffer_spec_set_color_format().

SetDepthStencilFormat

void SetDepthStencilFormat(
  DepthStencilFormat depth_stencil_format
)

Sets the depth and stencil format for this buffer.

For more information, see gvr_buffer_spec_set_depth_stencil_format().

SetMultiviewLayers

void SetMultiviewLayers(
  int32_t num_layers
)

For more information, see gvr_buffer_spec_set_multiview_layers().

SetSamples

void SetSamples(
  int32_t num_samples
)

Sets the number of samples per pixel.

For more information, see gvr_buffer_spec_set_samples().

SetSize

void SetSize(
  const Sizei & size
)

Sets the buffer's size.

For more information, see gvr_buffer_spec_set_size().

SetSize

void SetSize(
  int32_t width,
  int32_t height
)

Sets the buffer's size to the passed width and height.

For more information, see gvr_buffer_spec_set_size().

Details
Parameters
width
The width in pixels. Must be greater than 0.
height
The height in pixels. Must be greater than 0.