This site has been permanently archived. The content on this site was last updated in 2019.
Stay organized with collections
Save and categorize content based on your preferences.
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
int32_t GetSamples() const
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().
SetMultiviewLayers
void SetMultiviewLayers(
int32_t num_layers
)
SetSamples
void SetSamples(
int32_t num_samples
)
SetSize
void SetSize(
const Sizei & 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.
|
|
All rights reserved. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-09 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-09 UTC."],[[["\u003cp\u003e\u003ccode\u003egvr::BufferSpec\u003c/code\u003e is a C++ wrapper for \u003ccode\u003egvr_buffer_spec\u003c/code\u003e that simplifies pixel buffer specification in Google VR applications.\u003c/p\u003e\n"],["\u003cp\u003eIt automatically manages the underlying \u003ccode\u003egvr_buffer_spec\u003c/code\u003e memory, freeing it upon destruction.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can use \u003ccode\u003egvr::BufferSpec\u003c/code\u003e to define color format, depth and stencil format, size, and multiview layers of the buffer.\u003c/p\u003e\n"],["\u003cp\u003eIt provides convenient functions for setting and retrieving buffer properties like size, samples per pixel, and various formats.\u003c/p\u003e\n"],["\u003cp\u003eThis class inherits from \u003ccode\u003egvr::WrapperBase\u003c/code\u003e, offering a consistent interface for managing Google VR objects.\u003c/p\u003e\n"]]],["The `gvr::BufferSpec` class manages pixel buffer specifications, automatically freeing resources upon destruction. Key actions include: retrieving the number of samples per pixel via `GetSamples`, and obtaining the buffer's dimensions using `GetSize`. Users can also modify the buffer by setting the `ColorFormat`, `DepthStencilFormat`, number of `MultiviewLayers`, `Samples`, and buffer `Size`, with options to set dimensions by a structure or individual width and height.\n"],null,["# gvr::BufferSpec Class Reference\n\ngvr::BufferSpec\n===============\n\n`#include \u003cgvr.h\u003e`\n\nConvenience C++ wrapper for gvr_buffer_spec, an opaque pixel buffer specification.\n\nSummary\n-------\n\nFrees the underlying gvr_buffer_spec on destruction.\n\n### Inheritance\n\nInherits from: [gvr::WrapperBase\\\u003c gvr_buffer_spec, gvr_buffer_spec_destroy \\\u003e](/vr/reference/android-ndk/class/gvr/wrapper-base)\n\n| ### Public functions ||\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [GetSamples](#classgvr_1_1_buffer_spec_1aa119be2c255381eb11eb82c04fed4f7e)`() const ` | `int32_t` Gets the number of samples per pixel in the buffer. |\n| [GetSize](#classgvr_1_1_buffer_spec_1a7875d0304543e83a7ab30a06969ee585)`() const ` | [Sizei](/vr/reference/android-ndk/struct/gvr-sizei#structgvr__sizei) Gets the buffer's size. |\n| [SetColorFormat](#classgvr_1_1_buffer_spec_1abe68483a6bc18396c1f507fd76588fe6)`(`[ColorFormat](/vr/reference/android-ndk/group/types#group__types_1ga747712201709f746e836233b3a7f5f6f)` color_format)` | `void` Sets the color format for this buffer. |\n| [SetDepthStencilFormat](#classgvr_1_1_buffer_spec_1a6f92de5f4d1306daa9232e9e33c50492)`(`[DepthStencilFormat](/vr/reference/android-ndk/group/types#group__types_1ga31d3dccb5f5ab55ccd3ec23f2125647c)` depth_stencil_format)` | `void` Sets the depth and stencil format for this buffer. |\n| [SetMultiviewLayers](#classgvr_1_1_buffer_spec_1a3a1c45ca3f2b378324841cf3963f97dd)`(int32_t num_layers)` | `void` For more information, see [gvr_buffer_spec_set_multiview_layers()](/vr/reference/android-ndk/group/swap-chain#group__swap__chain_1gaf34db952ee9f9273f2c066f0cd71ff3c). |\n| [SetSamples](#classgvr_1_1_buffer_spec_1a73ad14cd07f0f430bb79627d2e5025db)`(int32_t num_samples)` | `void` Sets the number of samples per pixel. |\n| [SetSize](#classgvr_1_1_buffer_spec_1ac67b32cdd68e06c35a6321727ff0ec59)`(const `[Sizei](/vr/reference/android-ndk/struct/gvr-sizei#structgvr__sizei)` & size)` | `void` Sets the buffer's size. |\n| [SetSize](#classgvr_1_1_buffer_spec_1a96affe5dcdb115d9f8ca708a4213ae0f)`(int32_t width, int32_t height)` | `void` Sets the buffer's size to the passed width and height. |\n\nPublic functions\n----------------\n\n### GetSamples\n\n```gdscript\nint32_t GetSamples() const \n``` \nGets the number of samples per pixel in the buffer.\n\nFor more information, see [gvr_buffer_spec_get_samples()](/vr/reference/android-ndk/group/swap-chain#group__swap__chain_1ga6c3e623badde0e31a453fb20beed3cd5). \n\n### GetSize\n\n```gdscript\nSizei GetSize() const \n``` \nGets the buffer's size.\n\nThe default value is the recommended render target size. For more information, see [gvr_buffer_spec_get_size()](/vr/reference/android-ndk/group/swap-chain#group__swap__chain_1gadf3c47d724c000ed1d20309ccfa52e13). \n\n### SetColorFormat\n\n```scdoc\nvoid SetColorFormat(\n ColorFormat color_format\n)\n``` \nSets the color format for this buffer.\n\nFor more information, see [gvr_buffer_spec_set_color_format()](/vr/reference/android-ndk/group/swap-chain#group__swap__chain_1gac5506586cf626aedc3180a1d5ece57cf). \n\n### SetDepthStencilFormat\n\n```scdoc\nvoid SetDepthStencilFormat(\n DepthStencilFormat depth_stencil_format\n)\n``` \nSets the depth and stencil format for this buffer.\n\nFor more information, see [gvr_buffer_spec_set_depth_stencil_format()](/vr/reference/android-ndk/group/swap-chain#group__swap__chain_1ga27532df3cfe4f7b4155fd440afbae97c). \n\n### SetMultiviewLayers\n\n```scdoc\nvoid SetMultiviewLayers(\n int32_t num_layers\n)\n``` \nFor more information, see [gvr_buffer_spec_set_multiview_layers()](/vr/reference/android-ndk/group/swap-chain#group__swap__chain_1gaf34db952ee9f9273f2c066f0cd71ff3c). \n\n### SetSamples\n\n```scdoc\nvoid SetSamples(\n int32_t num_samples\n)\n``` \nSets the number of samples per pixel.\n\nFor more information, see [gvr_buffer_spec_set_samples()](/vr/reference/android-ndk/group/swap-chain#group__swap__chain_1ga98e719c897a400f9a6769c29cee483bd). \n\n### SetSize\n\n```gdscript\nvoid SetSize(\n const Sizei & size\n)\n``` \nSets the buffer's size.\n\nFor more information, see [gvr_buffer_spec_set_size()](/vr/reference/android-ndk/group/swap-chain#group__swap__chain_1gaf4e2efc083c248309566d33ad80fde7d). \n\n### SetSize\n\n```scdoc\nvoid SetSize(\n int32_t width,\n int32_t height\n)\n``` \nSets the buffer's size to the passed width and height.\n\nFor more information, see [gvr_buffer_spec_set_size()](/vr/reference/android-ndk/group/swap-chain#group__swap__chain_1gaf4e2efc083c248309566d33ad80fde7d).\n\n\u003cbr /\u003e\n\n| Details ||\n|------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Parameters | |----------|-----------------------------------------------| | `width` | The width in pixels. Must be greater than 0. | | `height` | The height in pixels. Must be greater than 0. | |"]]