
org.lwjgl.openxr.KHRVisibilityMask Maven / Gradle / Ivy
Show all versions of lwjgl-openxr Show documentation
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.openxr;
import org.lwjgl.system.*;
import static org.lwjgl.system.Checks.*;
import static org.lwjgl.system.JNI.*;
/**
* The XR_KHR_visibility_mask extension.
*
* This extension support the providing of a per-view drawing mask for applications. The primary purpose of this is to enable performance improvements that result from avoiding drawing on areas that are not visible to the user. A common occurrence in head-mounted VR hardware is that the optical system’s frustum does not intersect precisely with the rectangular display it is viewing. As a result, it may be that there are parts of the display that are not visible to the user, such as the corners of the display. In such cases it would be unnecessary for the application to draw into those parts.
*/
public class KHRVisibilityMask {
/** The extension specification version. */
public static final int XR_KHR_visibility_mask_SPEC_VERSION = 2;
/** The extension name. */
public static final String XR_KHR_VISIBILITY_MASK_EXTENSION_NAME = "XR_KHR_visibility_mask";
/**
* Extends {@code XrStructureType}.
*
* Enum values:
*
*
* - {@link #XR_TYPE_VISIBILITY_MASK_KHR TYPE_VISIBILITY_MASK_KHR}
* - {@link #XR_TYPE_EVENT_DATA_VISIBILITY_MASK_CHANGED_KHR TYPE_EVENT_DATA_VISIBILITY_MASK_CHANGED_KHR}
*
*/
public static final int
XR_TYPE_VISIBILITY_MASK_KHR = 1000031000,
XR_TYPE_EVENT_DATA_VISIBILITY_MASK_CHANGED_KHR = 1000031001;
/**
* XrVisibilityMaskTypeKHR - Visibility Mask Type
*
* Enumerant Descriptions
*
*
* - {@link #XR_VISIBILITY_MASK_TYPE_HIDDEN_TRIANGLE_MESH_KHR VISIBILITY_MASK_TYPE_HIDDEN_TRIANGLE_MESH_KHR} refers to a two dimensional triangle mesh on the view surface which should not be drawn to by the application. {@link XrVisibilityMaskKHR} refers to a set of triangles identified by vertices and vertex indices. The index count will thus be a multiple of three. The triangle vertices will be returned in counter-clockwise order as viewed from the user perspective.
* - {@link #XR_VISIBILITY_MASK_TYPE_VISIBLE_TRIANGLE_MESH_KHR VISIBILITY_MASK_TYPE_VISIBLE_TRIANGLE_MESH_KHR} refers to a two dimensional triangle mesh on the view surface which should be drawn to by the application. {@link XrVisibilityMaskKHR} refers to a set of triangles identified by vertices and vertex indices. The index count will thus be a multiple of three. The triangle vertices will be returned in counter-clockwise order as viewed from the user perspective.
* - {@link #XR_VISIBILITY_MASK_TYPE_LINE_LOOP_KHR VISIBILITY_MASK_TYPE_LINE_LOOP_KHR} refers to a single multi-segmented line loop on the view surface which encompasses the view area which should be drawn by the application. It is the border that exists between the visible and hidden meshes identified by {@link #XR_VISIBILITY_MASK_TYPE_HIDDEN_TRIANGLE_MESH_KHR VISIBILITY_MASK_TYPE_HIDDEN_TRIANGLE_MESH_KHR} and {@link #XR_VISIBILITY_MASK_TYPE_VISIBLE_TRIANGLE_MESH_KHR VISIBILITY_MASK_TYPE_VISIBLE_TRIANGLE_MESH_KHR}. The line is counter-clockwise, contiguous, and non-self crossing, with the last point implicitly connecting to the first point. There is one vertex per point, the index count will equal the vertex count, and the indices will refer to the vertices.
*
*
* See Also
*
* {@link #xrGetVisibilityMaskKHR GetVisibilityMaskKHR}
*/
public static final int
XR_VISIBILITY_MASK_TYPE_HIDDEN_TRIANGLE_MESH_KHR = 1,
XR_VISIBILITY_MASK_TYPE_VISIBLE_TRIANGLE_MESH_KHR = 2,
XR_VISIBILITY_MASK_TYPE_LINE_LOOP_KHR = 3;
protected KHRVisibilityMask() {
throw new UnsupportedOperationException();
}
// --- [ xrGetVisibilityMaskKHR ] ---
/** Unsafe version of: {@link #xrGetVisibilityMaskKHR GetVisibilityMaskKHR} */
public static int nxrGetVisibilityMaskKHR(XrSession session, int viewConfigurationType, int viewIndex, int visibilityMaskType, long visibilityMask) {
long __functionAddress = session.getCapabilities().xrGetVisibilityMaskKHR;
if (CHECKS) {
check(__functionAddress);
}
return callPPI(session.address(), viewConfigurationType, viewIndex, visibilityMaskType, visibilityMask, __functionAddress);
}
/**
* Gets visibility mask.
*
* C Specification
*
* The {@link #xrGetVisibilityMaskKHR GetVisibilityMaskKHR} function is defined as:
*
*
* XrResult xrGetVisibilityMaskKHR(
* XrSession session,
* XrViewConfigurationType viewConfigurationType,
* uint32_t viewIndex,
* XrVisibilityMaskTypeKHR visibilityMaskType,
* XrVisibilityMaskKHR* visibilityMask);
*
* Description
*
* {@link #xrGetVisibilityMaskKHR GetVisibilityMaskKHR} retrieves the view mask for a given view. This function follows the two-call idiom for filling multiple buffers in a struct. Specifically, if either {@link XrVisibilityMaskKHR}{@code ::vertexCapacityInput} or {@link XrVisibilityMaskKHR}{@code ::indexCapacityInput} is 0, the runtime must respond as if both fields were set to 0, returning the vertex count and index count through {@link XrVisibilityMaskKHR}{@code ::vertexCountOutput} or {@link XrVisibilityMaskKHR}{@code ::indexCountOutput} respectively. If a view mask for the specified view isn’t available, the returned vertex and index counts must be 0.
*
* Valid Usage (Implicit)
*
*
* - The {@link KHRVisibilityMask XR_KHR_visibility_mask} extension must be enabled prior to calling {@link #xrGetVisibilityMaskKHR GetVisibilityMaskKHR}
* - {@code session} must be a valid {@code XrSession} handle
* - {@code viewConfigurationType} must be a valid {@code XrViewConfigurationType} value
* - {@code visibilityMaskType} must be a valid {@code XrVisibilityMaskTypeKHR} value
* - {@code visibilityMask} must be a pointer to an {@link XrVisibilityMaskKHR} structure
*
*
* Return Codes
*
*
* - On success, this command returns
*
* - {@link XR10#XR_SUCCESS SUCCESS}
* - {@link XR10#XR_SESSION_LOSS_PENDING SESSION_LOSS_PENDING}
*
* - On failure, this command returns
*
* - {@link XR10#XR_ERROR_FUNCTION_UNSUPPORTED ERROR_FUNCTION_UNSUPPORTED}
* - {@link XR10#XR_ERROR_VALIDATION_FAILURE ERROR_VALIDATION_FAILURE}
* - {@link XR10#XR_ERROR_RUNTIME_FAILURE ERROR_RUNTIME_FAILURE}
* - {@link XR10#XR_ERROR_HANDLE_INVALID ERROR_HANDLE_INVALID}
* - {@link XR10#XR_ERROR_INSTANCE_LOST ERROR_INSTANCE_LOST}
* - {@link XR10#XR_ERROR_SESSION_LOST ERROR_SESSION_LOST}
* - {@link XR10#XR_ERROR_SIZE_INSUFFICIENT ERROR_SIZE_INSUFFICIENT}
* - {@link XR10#XR_ERROR_VIEW_CONFIGURATION_TYPE_UNSUPPORTED ERROR_VIEW_CONFIGURATION_TYPE_UNSUPPORTED}
*
*
*
* See Also
*
* {@link XrVisibilityMaskKHR}
*
* @param session an {@code XrSession} handle previously created with {@link XR10#xrCreateSession CreateSession}.
* @param viewConfigurationType the view configuration from which to retrieve mask information.
* @param viewIndex the individual view within the view configuration from which to retrieve mask information.
* @param visibilityMaskType the type of visibility mask requested.
* @param visibilityMask an input/output struct which specifies the view mask.
*/
@NativeType("XrResult")
public static int xrGetVisibilityMaskKHR(XrSession session, @NativeType("XrViewConfigurationType") int viewConfigurationType, @NativeType("uint32_t") int viewIndex, @NativeType("XrVisibilityMaskTypeKHR") int visibilityMaskType, @NativeType("XrVisibilityMaskKHR *") XrVisibilityMaskKHR visibilityMask) {
return nxrGetVisibilityMaskKHR(session, viewConfigurationType, viewIndex, visibilityMaskType, visibilityMask.address());
}
}