Crate gvr_sys [] [src]

Structs

div_t
gvr_buffer_spec_
gvr_buffer_viewport_
gvr_buffer_viewport_list_
gvr_clock_time_point

A monotonic system time representation. On Android, this is equivalent to System.nanoTime(), or clock_gettime(CLOCK_MONOTONIC). If there is any doubt about how to get the current time for the current platform, simply use gvr_get_time_point_now().

gvr_context_
gvr_controller_state_
gvr_frame_
gvr_mat4f

A floating point 4x4 matrix.

gvr_quatf

A floating point quaternion, in JPL format. We use this simple struct in order not to impose a dependency on a particular math library. The user of this API is free to encapsulate this into any math library they want.

gvr_rectf

A floating point 2D rect. Used for field of view, and also for ranges in texture space. When used for a field of view, all angles are in positive degrees from the optical axis.

gvr_recti

An integral 2D rect. Used for window bounds in pixels.

gvr_sizei

An integral 2D size. Used for render target sizes.

gvr_swap_chain_
gvr_user_prefs_
gvr_vec2f

A floating point 2D vector.

gvr_vec3f

A floating point 3D vector.

gvr_version_

Version information for the Google VR API.

ldiv_t
lldiv_t

Enums

_bindgen_ty_1

Controller API options (bit flags).

_bindgen_ty_2
gvr_audio_distance_rolloff_type

Distance rolloff models used for distance attenuation.

gvr_audio_material_type

Room surface material names, used to set room properties.

gvr_audio_rendering_mode

Rendering modes define CPU load / rendering quality balances.

gvr_audio_surround_format_type

Supported surround sound formats.

gvr_color_format_type

Valid color formats for swap chain buffers.

gvr_controller_api_status

Constants that represent the status of the controller API.

gvr_controller_battery_level

Controller battery states.

gvr_controller_button

Controller buttons.

gvr_controller_connection_state

Constants that represent the state of the controller.

gvr_controller_handedness
gvr_depth_stencil_format_type
gvr_error

Constants that represent GVR error codes.

gvr_eye

An enum for the left and right eye.

gvr_feature
gvr_reprojection

Types of asynchronous reprojection.

gvr_viewer_type

The type of VR viewer.

Constants

EXIT_FAILURE
EXIT_SUCCESS
GVR_BUFFER_INDEX_EXTERNAL_SURFACE
GVR_CONTROLLER_ENABLE_ACCEL
GVR_CONTROLLER_ENABLE_BATTERY
GVR_CONTROLLER_ENABLE_GESTURES
GVR_CONTROLLER_ENABLE_GYRO
GVR_CONTROLLER_ENABLE_ORIENTATION
GVR_CONTROLLER_ENABLE_POSE_PREDICTION
GVR_CONTROLLER_ENABLE_POSITION
GVR_CONTROLLER_ENABLE_TOUCH
GVR_EXTERNAL_SURFACE_ID_NONE
INT16_MAX
INT16_MIN
INT32_MAX
INT32_MIN
INT8_MAX
INT8_MIN
INTPTR_MAX
INTPTR_MIN
INT_FAST16_MAX
INT_FAST16_MIN
INT_FAST32_MAX
INT_FAST32_MIN
INT_FAST8_MAX
INT_FAST8_MIN
INT_LEAST16_MAX
INT_LEAST16_MIN
INT_LEAST32_MAX
INT_LEAST32_MIN
INT_LEAST8_MAX
INT_LEAST8_MIN
PTRDIFF_MAX
PTRDIFF_MIN
RAND_MAX
SIG_ATOMIC_MAX
SIG_ATOMIC_MIN
SIZE_MAX
UINT16_MAX
UINT32_MAX
UINT8_MAX
UINTPTR_MAX
UINT_FAST16_MAX
UINT_FAST32_MAX
UINT_FAST8_MAX
UINT_LEAST16_MAX
UINT_LEAST32_MAX
UINT_LEAST8_MAX
WINT_MAX
WINT_MIN
_BITS_WCHAR_H
_FEATURES_H
_STDC_PREDEF_H
_STDINT_H
_STDLIB_H
_SYS_CDEFS_H
__GLIBC_MINOR__
__GLIBC__
__GNU_LIBRARY__
__STDC_IEC_559_COMPLEX__
__STDC_IEC_559__
__STDC_ISO_10646__
__STDC_NO_THREADS__
__SYSCALL_WORDSIZE
__USE_FORTIFY_LEVEL
__USE_ISOC95
__USE_ISOC99
__WORDSIZE
__WORDSIZE_TIME64_COMPAT32
__bool_true_false_are_defined
__ldiv_t_defined
false_
true_

Functions

_Exit
__ctype_get_mb_cur_max
abort
abs
atexit
atof
atoi
atol
atoll
bsearch
calloc
div
exit
free
getenv
gvr_apply_neck_model

Applies a simple neck model translation based on the rotation of the provided head pose.

gvr_bind_default_framebuffer

Resets the OpenGL framebuffer binding to what it was at the time the passed gvr_context was created.

gvr_buffer_spec_create

Creates a default buffer specification.

gvr_buffer_spec_destroy

Destroy the buffer specification and null the pointer.

gvr_buffer_spec_get_samples

Gets the number of samples per pixel in the buffer to be created.

gvr_buffer_spec_get_size

Gets the size of the buffer to be created.

gvr_buffer_spec_set_color_format

Sets the color format for the buffer to be created. Default format is GVR_COLOR_FORMAT_RGBA_8888.

gvr_buffer_spec_set_depth_stencil_format

Sets the depth and stencil format for the buffer to be created. Currently, only packed stencil formats are supported. Default format is GVR_DEPTH_STENCIL_FORMAT_DEPTH_16.

gvr_buffer_spec_set_samples

Sets the number of samples per pixel in the buffer to be created.

gvr_buffer_spec_set_size

Sets the size of the buffer to be created.

gvr_buffer_viewport_create

Creates a gvr_buffer_viewport instance.

gvr_buffer_viewport_destroy

Frees a gvr_buffer_viewport instance and clears the pointer.

gvr_buffer_viewport_equal

Compares two gvr_buffer_viewport instances and returns true if they specify the same view mapping.

gvr_buffer_viewport_get_external_surface_id

Gets the ID of the externally-managed Surface texture from which this viewport reads undistored pixels.

gvr_buffer_viewport_get_reprojection

Gets the type of reprojection to perform on the specified viewport.

gvr_buffer_viewport_get_source_buffer_index

Gets the index of the source buffer from which the viewport reads its undistorted pixels.

gvr_buffer_viewport_get_source_fov

Retrieves the field of view for the referenced buffer region.

gvr_buffer_viewport_get_source_uv

Gets the UV coordinates specifying where the output buffer is sampled.

gvr_buffer_viewport_get_target_eye

Gets the target logical eye for the specified viewport.

gvr_buffer_viewport_get_transform

Gets the matrix that positions the viewport in eye space.

gvr_buffer_viewport_list_create

returned object when it is no longer needed.

gvr_buffer_viewport_list_destroy

Destroys a gvr_buffer_viewport_list instance. The parameter will be nulled by this operation.

gvr_buffer_viewport_list_get_item

Retrieve a buffer viewport entry from a list.

gvr_buffer_viewport_list_get_size

Returns the size of the given viewport list.

gvr_buffer_viewport_list_set_item

Update an element of the viewport list or append a new one at the end.

gvr_buffer_viewport_set_external_surface_id

Sets the ID of the externally-managed Surface texture from which this viewport reads. The ID is issued by GvrLayout.

gvr_buffer_viewport_set_reprojection

Sets the type of reprojection to perform on the specified viewport. Viewports that display world content should use full reprojection. Viewports that display head-locked UI should disable reprojection to avoid excessive judder. The default is to perform full reprojection.

gvr_buffer_viewport_set_source_buffer_index

Sets the buffer from which the viewport reads its undistorted pixels.

gvr_buffer_viewport_set_source_fov

Sets the field of view for the viewport contents.

gvr_buffer_viewport_set_source_uv

Sets the UV coordinates specifying where the output buffer should be sampled when compositing the final distorted image.

gvr_buffer_viewport_set_target_eye

Sets the target logical eye for the specified viewport.

gvr_buffer_viewport_set_transform

Sets the matrix that positions the viewport in eye space.

gvr_clear_error

Clears the current GVR error code, and returns the error code that was cleared.

gvr_compute_distorted_point

Computes the distorted point for a given point in a given eye. The distortion inverts the optical distortion caused by the lens for the eye. Due to chromatic aberration, the distortion is different for each color channel.

gvr_create

@return Pointer to the created gvr instance, NULL on failure.

gvr_destroy

Destroys a gvr_context instance. The parameter will be nulled by this operation. Once this function is called, the behavior of any subsequent call to a GVR SDK function that references objects created from this context is undefined.

gvr_distort_to_screen

@deprecated Use the Swap Chain API instead. This function exists only to support legacy rendering pathways for Cardboard devices. It is incompatible with the low-latency experiences supported by async reprojection.

gvr_frame_bind_buffer

Binds a pixel buffer that is part of the frame to the OpenGL framebuffer.

gvr_frame_get_buffer_size

Returns the dimensions of the pixel buffer with the specified index. Note that a frame that was acquired before resizing a swap chain buffer will not be resized until it is submitted to the swap chain.

gvr_frame_get_framebuffer_object

Gets the name (ID) of the framebuffer object associated with the specified buffer. The OpenGL state is not modified.

gvr_frame_submit

Submits the frame for distortion and display on the screen. The passed pointer is nulled to prevent reuse.

gvr_frame_unbind

Unbinds any buffers bound from this frame and binds the default OpenGL framebuffer.

gvr_get_async_reprojection_enabled

Gets whether asynchronous reprojection is currently enabled.

gvr_get_error

Gets the current GVR error code, or GVR_ERROR_NONE if there is no error. This function doesn't clear the error code; see gvr_clear_error().

gvr_get_error_string

Gets a human-readable string representing the given error code.

gvr_get_eye_from_head_matrix

Gets the transformation matrix to convert from Head Space to Eye Space for the given eye.

gvr_get_head_space_from_start_space_rotation

Gets the rotation from start space to head space. The head space is a space where the head is at the origin and faces the -Z direction.

gvr_get_maximum_effective_render_target_size

Returns the maximum effective size for the client's render target, given the parameters of the head mounted device selected. At this resolution, we have a 1:1 ratio between source pixels and screen pixels in the most magnified region of the screen. Applications should rarely, if ever, need to render to a larger target, as it will simply result in sampling artifacts.

gvr_get_recommended_buffer_viewports

Gets the recommended buffer viewport configuration, populating a previously allocated gvr_buffer_viewport_list object. The updated values include the per-eye recommended viewport and field of view for the target.

gvr_get_screen_buffer_viewports

Gets the screen (non-distorted) buffer viewport configuration, populating a previously allocated gvr_buffer_viewport_list object. The updated values include the per-eye recommended viewport and field of view for the target.

gvr_get_screen_target_size

Returns a non-distorted size for the screen, given the parameters of the phone and/or the head mounted device selected.

gvr_get_time_point_now

Gets the current monotonic system time.

gvr_get_user_prefs

Returns an opaque struct containing information about user preferences.

gvr_get_version

Gets the current GVR runtime version.

gvr_get_version_string

Gets a string representation of the current GVR runtime version. This is of the form "MAJOR.MINOR.PATCH".

gvr_get_viewer_model

Gets the name of the viewer model.

gvr_get_viewer_type

Gets the type of the viewer, as defined by gvr_viewer_type.

gvr_get_viewer_vendor

Gets the name of the viewer vendor.

gvr_get_window_bounds

Gets the window bounds.

gvr_initialize_gl

Initializes necessary GL-related objects and uses the current thread and GL context for rendering. Please make sure that a valid GL context is available when this function is called. This should never be called more than once on the same GL context (doing so would cause resource leaks).

gvr_is_feature_supported

Queries whether a particular GVR feature is supported by the underlying platform.

gvr_pause_tracking

Pauses head tracking, disables all sensors (to save power).

gvr_recenter_tracking

Recenters the head orientation (resets the yaw to zero, leaving pitch and roll unmodified).

gvr_refresh_viewer_profile

Refreshes gvr_context with the viewer profile that is stored on the device. If it can not find the viewer profile, nothing will happen.

gvr_reset_tracking

@deprecated Calls to this method can be safely replaced by calls to gvr_recenter_tracking. This accomplishes the same effects but avoids the undesirable side-effects of a full reset (temporary loss of tracking quality).

gvr_resume_tracking

Resumes head tracking, re-enables all sensors.

gvr_set_default_viewer_profile

Sets the default viewer profile specified by viewer_profile_uri. The viewer_profile_uri that is passed in will be ignored if a valid viewer profile has already been stored on the device that the app is running on.

gvr_set_surface_size
gvr_swap_chain_acquire_frame

Acquires a frame from the swap chain for rendering. Buffers that are part of the frame can then be bound with gvr_frame_bind_buffer(). Once the frame is finished and all its constituent buffers are ready, call gvr_frame_submit() to display it while applying lens distortion.

gvr_swap_chain_create

Creates a swap chain from the given buffer specifications. This is a potentially time-consuming operation. All frames within the swapchain will be allocated. Once rendering is stopped, call gvr_swap_chain_destroy() to free GPU resources. The passed gvr_context must not be destroyed until then.

gvr_swap_chain_destroy

Destroys the swap chain and nulls the pointer.

gvr_swap_chain_get_buffer_count

Gets the number of buffers in each frame of the swap chain.

gvr_swap_chain_get_buffer_size

Retrieves the size of the specified pixel buffer. Note that if the buffer was resized while the current frame was acquired, the return value will be different than the value obtained from the equivalent function for the current frame.

gvr_swap_chain_resize_buffer

Resizes the specified pixel buffer to the given size. The frames are resized when they are unused, so the currently acquired frame will not be resized immediately.

gvr_user_prefs_get_controller_handedness

Returns the controller handedness of the given gvr_user_prefs struct.

labs
ldiv
llabs
lldiv
malloc
mblen
mbstowcs
mbtowc
qsort
rand
realloc
srand
strtod
strtof
strtol
strtold
strtoll
strtoul
strtoull
system
wcstombs
wctomb

Type Definitions

__compar_fn_t
gvr_audio_source_id

Sound object and sound field identifier.

gvr_buffer_spec

Specification of a pixel buffer. A pixel buffer can have color, depth and stencil attachments and mostly corresponds to the OpenGL concept of a framebuffer object. However, since there can be multiple such objects for each frame, we avoid calling them "framebuffers". Pixel buffers which are part of the currently acquired frame are immutable, i.e., they cannot be resized or otherwise reconfigured.

gvr_buffer_viewport

A structure that ties together a region of a buffer, the field of view rendered into that region and a target eye index to define part of the user's field of view. The SDK implementation uses this information to transform the images generated by the app output into the final display that is sent to the screen.

gvr_buffer_viewport_list

List of buffer viewports that completely specifies how to transform the frame's buffers into the image displayed on the screen.

gvr_context

Primary context for invoking Google VR APIs.

gvr_controller_state

Opaque handle to controller state.

gvr_frame

A single frame acquired from the swap chain. Each frame is composed of one or more buffers, which are then lens distorted and composited into the final output. Buffers are identified by indices that correspond to the position of their gvr_buffer_spec in the list passed when constructing the swap chain.

gvr_swap_chain

Swap chain that contains some number of frames. Frames in the swap chain can be unused, in the process of being distorted and presented on the screen, or acquired and being rendered to by the application. The swap chain ensures that the most recent available frame is always shown and that the application never has to wait to render the next frame.

gvr_user_prefs
gvr_version
int_fast16_t
int_fast32_t
int_fast64_t
int_fast8_t
int_least16_t
int_least32_t
int_least64_t
int_least8_t
intmax_t
uint_fast16_t
uint_fast32_t
uint_fast64_t
uint_fast8_t
uint_least16_t
uint_least32_t
uint_least64_t
uint_least8_t
uintmax_t
wchar_t