Function ovr_sys::ovr_SubmitFrame [] [src]

pub unsafe extern "C" fn ovr_SubmitFrame(
    session: ovrSession,
    frameIndex: c_longlong,
    viewScaleDesc: *const ovrViewScaleDesc,
    layerPtrList: *const *const ovrLayerHeader,
    layerCount: c_uint
) -> ovrResult

Submits layers for distortion and display.

ovr_SubmitFrame triggers distortion and processing which might happen asynchronously.

The function will return when there is room in the submission queue and surfaces are available. Distortion might or might not have completed.

session Specifies an ovrSession previously returned by ovr_Create.

frameIndex Specifies the targeted application frame index, or 0 to refer to one frame after the last time ovr_SubmitFrame was called.

viewScaleDesc Provides additional information needed only if layerPtrList contains an ovrLayerType_Quad. If NULL, a default version is used based on the current configuration and a 1.0 world scale.

layerPtrList Specifies a list of ovrLayer pointers, which can include NULL entries to indicate that any previously shown layer at that index is to not be displayed.

Each layer header must be a part of a layer structure such as ovrLayerEyeFov or ovrLayerQuad, with Header.Type identifying its type. A NULL layerPtrList entry in the array indicates the absence of the given layer.

layerCount Indicates the number of valid elements in layerPtrList. The maximum supported layerCount is not currently specified, but may be specified in a future version.

Example code

// In initialisation
let layer0: ovrLayerEyeFov = foo();
let layer1: ovrLayerQuad = bar();
// In frame loop
let layers = [&layer0.Header as *const _, &layer1.Header as *const _];
let result = ovr_SubmitFrame(session, frame_index, ptr::null(), layers.as_ptr(), 2);

Returns an ovrResult for which OVR_SUCCESS(result) is false upon error and true upon success. Return values include but aren't limited to:

see ovr_GetPredictedDisplayTime, ovrViewScaleDesc, ovrLayerHeader