Class XrActionCreateInfo
- All Implemented Interfaces:
AutoCloseable,org.lwjgl.system.NativeResource,org.lwjgl.system.Pointer
Description
Subaction paths are a mechanism that enables applications to use the same action name and handle on multiple devices. Applications can query action state using subaction paths that differentiate data coming from each device. This allows the runtime to group logically equivalent actions together in system UI. For instance, an application could create a single actionname:pick_up action with the pathname:/user/hand/left and pathname:/user/hand/right subaction paths and use the subaction paths to independently query the state of actionname:pick_up_with_left_hand and actionname:pick_up_with_right_hand.
Applications can create actions with or without the subactionPaths set to a list of paths. If this list of paths is omitted (i.e. subactionPaths is set to NULL, and countSubactionPaths is set to 0), the application is opting out of filtering action results by subaction paths and any call to get action data must also omit subaction paths.
If subactionPaths is specified and any of the following conditions are not satisfied, the runtime must return ERROR_PATH_UNSUPPORTED:
- Each path provided is one of:
- pathname:/user/head
- pathname:/user/hand/left
- pathname:/user/hand/right
- pathname:/user/gamepad
- No path appears in the list more than once
Extensions may append additional top level user paths to the above list.
Note
Earlier revisions of the spec mentioned pathname:/user but it could not be implemented as specified and was removed as errata.
The runtime must return ERROR_PATH_UNSUPPORTED in the following circumstances:
- The application specified subaction paths at action creation and the application called
xrGetActionState*or a haptic function with an empty subaction path array. - The application called
xrGetActionState*or a haptic function with a subaction path that was not specified when the action was created.
If actionName or localizedActionName are empty strings, the runtime must return ERROR_NAME_INVALID or ERROR_LOCALIZED_NAME_INVALID respectively. If actionName or localizedActionName are duplicates of the corresponding field for any existing action in the specified action set, the runtime must return ERROR_NAME_DUPLICATED or ERROR_LOCALIZED_NAME_DUPLICATED respectively. If the conflicting action is destroyed, the conflicting field is no longer considered duplicated. If actionName contains characters which are not allowed in a single level of a well-formed path string, the runtime must return ERROR_PATH_FORMAT_INVALID.
Valid Usage (Implicit)
typemust beTYPE_ACTION_CREATE_INFOnextmust beNULLor a valid pointer to the next structure in a structure chainactionNamemust be a null-terminated UTF-8 string whose length is less than or equal toMAX_ACTION_NAME_SIZEactionTypemust be a validXrActionTypevalue- If
countSubactionPathsis not 0,subactionPathsmust be a pointer to an array ofcountSubactionPathsvalidXrPathvalues localizedActionNamemust be a null-terminated UTF-8 string whose length is less than or equal toMAX_LOCALIZED_ACTION_NAME_SIZE
See Also
Layout
struct XrActionCreateInfo {
XrStructureType type();
void const * next();
char actionName()[XR_MAX_ACTION_NAME_SIZE];
XrActionType actionType();
uint32_t countSubactionPaths();
XrPath const * subactionPaths();
char localizedActionName()[XR_MAX_LOCALIZED_ACTION_NAME_SIZE];
}-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.lwjgl.system.Struct
org.lwjgl.system.Struct.StructValidationNested classes/interfaces inherited from interface org.lwjgl.system.Pointer
org.lwjgl.system.Pointer.Default -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct alignment in bytes.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct size in bytes.static final intThe struct member offsets.static final intThe struct member offsets.Fields inherited from interface org.lwjgl.system.Pointer
BITS32, BITS64, CLONG_SHIFT, CLONG_SIZE, POINTER_SHIFT, POINTER_SIZE -
Constructor Summary
ConstructorsConstructorDescriptionXrActionCreateInfo(ByteBuffer container) Creates aXrActionCreateInfoinstance at the current position of the specifiedByteBuffercontainer. -
Method Summary
Modifier and TypeMethodDescriptionan array containing aNULLterminated string with the name of this action.actionName(ByteBuffer value) Copies the specified encoded string to theactionName()field.an array containing aNULLterminated string with the name of this action.inttheXrActionTypeof the action to be created.actionType(int value) Sets the specified value to theactionType()field.static XrActionCreateInfocalloc()Returns a newXrActionCreateInfoinstance allocated withmemCalloc.static XrActionCreateInfo.Buffercalloc(int capacity) Returns a newXrActionCreateInfo.Bufferinstance allocated withmemCalloc.static XrActionCreateInfo.Buffercalloc(int capacity, org.lwjgl.system.MemoryStack stack) Returns a newXrActionCreateInfo.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static XrActionCreateInfocalloc(org.lwjgl.system.MemoryStack stack) Returns a newXrActionCreateInfoinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.intthe number of elements in thesubactionPathsarray.countSubactionPaths(int value) Sets the specified value to thecountSubactionPaths()field.static XrActionCreateInfocreate()Returns a newXrActionCreateInfoinstance allocated withBufferUtils.static XrActionCreateInfo.Buffercreate(int capacity) Returns a newXrActionCreateInfo.Bufferinstance allocated withBufferUtils.static XrActionCreateInfocreate(long address) Returns a newXrActionCreateInfoinstance for the specified memory address.static XrActionCreateInfo.Buffercreate(long address, int capacity) Create aXrActionCreateInfo.Bufferinstance at the specified memory.static @Nullable XrActionCreateInfocreateSafe(long address) static @Nullable XrActionCreateInfo.BuffercreateSafe(long address, int capacity) an array containing aNULLterminatedUTF-8 string that can be presented to the user as a description of the action.localizedActionName(ByteBuffer value) Copies the specified encoded string to thelocalizedActionName()field.an array containing aNULLterminatedUTF-8 string that can be presented to the user as a description of the action.static XrActionCreateInfomalloc()Returns a newXrActionCreateInfoinstance allocated withmemAlloc.static XrActionCreateInfo.Buffermalloc(int capacity) Returns a newXrActionCreateInfo.Bufferinstance allocated withmemAlloc.static XrActionCreateInfo.Buffermalloc(int capacity, org.lwjgl.system.MemoryStack stack) Returns a newXrActionCreateInfo.Bufferinstance allocated on the specifiedMemoryStack.static XrActionCreateInfomalloc(org.lwjgl.system.MemoryStack stack) Returns a newXrActionCreateInfoinstance allocated on the specifiedMemoryStack.static ByteBuffernactionName(long struct) Unsafe version ofactionName().static voidnactionName(long struct, ByteBuffer value) Unsafe version ofactionName.static StringnactionNameString(long struct) Unsafe version ofactionNameString().static intnactionType(long struct) Unsafe version ofactionType().static voidnactionType(long struct, int value) Unsafe version ofactionType.static intncountSubactionPaths(long struct) Unsafe version ofcountSubactionPaths().static voidncountSubactionPaths(long struct, int value) Sets the specified value to thecountSubactionPathsfield of the specifiedstruct.longnext()NULLor a pointer to the next structure in a structure chain.next(long value) Sets the specified value to thenext()field.static ByteBuffernlocalizedActionName(long struct) Unsafe version oflocalizedActionName().static voidnlocalizedActionName(long struct, ByteBuffer value) Unsafe version oflocalizedActionName.static StringnlocalizedActionNameString(long struct) Unsafe version oflocalizedActionNameString().static longnnext(long struct) Unsafe version ofnext().static voidnnext(long struct, long value) Unsafe version ofnext.static @Nullable LongBuffernsubactionPaths(long struct) Unsafe version ofsubactionPaths.static voidnsubactionPaths(long struct, @Nullable LongBuffer value) Unsafe version ofsubactionPaths.static intntype(long struct) Unsafe version oftype().static voidntype(long struct, int value) Unsafe version oftype.set(int type, long next, ByteBuffer actionName, int actionType, int countSubactionPaths, @Nullable LongBuffer subactionPaths, ByteBuffer localizedActionName) Initializes this struct with the specified values.set(XrActionCreateInfo src) Copies the specified struct data to this struct.intsizeof()@Nullable LongBufferan array ofXrPathorNULL.subactionPaths(@Nullable LongBuffer value) Sets the address of the specifiedLongBufferto thesubactionPaths()field.inttype()theXrStructureTypeof this structure.type(int value) Sets the specified value to thetype()field.Sets theTYPE_ACTION_CREATE_INFOvalue to thetype()field.Methods inherited from class org.lwjgl.system.Struct
clear, free, isNull, validate, validateMethods inherited from class org.lwjgl.system.Pointer.Default
address, equals, hashCode, toStringMethods inherited from interface org.lwjgl.system.NativeResource
close, free
-
Field Details
-
SIZEOF
public static final int SIZEOFThe struct size in bytes. -
ALIGNOF
public static final int ALIGNOFThe struct alignment in bytes. -
TYPE
public static final int TYPEThe struct member offsets. -
NEXT
public static final int NEXTThe struct member offsets. -
ACTIONNAME
public static final int ACTIONNAMEThe struct member offsets. -
ACTIONTYPE
public static final int ACTIONTYPEThe struct member offsets. -
COUNTSUBACTIONPATHS
public static final int COUNTSUBACTIONPATHSThe struct member offsets. -
SUBACTIONPATHS
public static final int SUBACTIONPATHSThe struct member offsets. -
LOCALIZEDACTIONNAME
public static final int LOCALIZEDACTIONNAMEThe struct member offsets.
-
-
Constructor Details
-
XrActionCreateInfo
Creates aXrActionCreateInfoinstance at the current position of the specifiedByteBuffercontainer. Changes to the buffer's content will be visible to the struct instance and vice versa.The created instance holds a strong reference to the container object.
-
-
Method Details
-
sizeof
public int sizeof()- Specified by:
sizeofin classorg.lwjgl.system.Struct<XrActionCreateInfo>
-
type
public int type()theXrStructureTypeof this structure. -
next
public long next()NULLor a pointer to the next structure in a structure chain. No such structures are defined in core OpenXR. -
actionName
an array containing aNULLterminated string with the name of this action. -
actionNameString
an array containing aNULLterminated string with the name of this action. -
actionType
public int actionType()theXrActionTypeof the action to be created. -
countSubactionPaths
public int countSubactionPaths()the number of elements in thesubactionPathsarray. IfsubactionPathsis NULL, this parameter must be 0. -
subactionPaths
an array ofXrPathorNULL. If this array is specified, it contains one or more subaction paths that the application intends to query action state for. -
localizedActionName
an array containing aNULLterminatedUTF-8 string that can be presented to the user as a description of the action. This string should be in the system’s current active locale. -
localizedActionNameString
an array containing aNULLterminatedUTF-8 string that can be presented to the user as a description of the action. This string should be in the system’s current active locale. -
type
Sets the specified value to thetype()field. -
type$Default
Sets theTYPE_ACTION_CREATE_INFOvalue to thetype()field. -
next
Sets the specified value to thenext()field. -
actionName
Copies the specified encoded string to theactionName()field. -
actionType
Sets the specified value to theactionType()field. -
countSubactionPaths
Sets the specified value to thecountSubactionPaths()field. -
subactionPaths
Sets the address of the specifiedLongBufferto thesubactionPaths()field. -
localizedActionName
Copies the specified encoded string to thelocalizedActionName()field. -
set
public XrActionCreateInfo set(int type, long next, ByteBuffer actionName, int actionType, int countSubactionPaths, @Nullable LongBuffer subactionPaths, ByteBuffer localizedActionName) Initializes this struct with the specified values. -
set
Copies the specified struct data to this struct.- Parameters:
src- the source struct- Returns:
- this struct
-
malloc
Returns a newXrActionCreateInfoinstance allocated withmemAlloc. The instance must be explicitly freed. -
calloc
Returns a newXrActionCreateInfoinstance allocated withmemCalloc. The instance must be explicitly freed. -
create
Returns a newXrActionCreateInfoinstance allocated withBufferUtils. -
create
Returns a newXrActionCreateInfoinstance for the specified memory address. -
createSafe
-
malloc
Returns a newXrActionCreateInfo.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
Returns a newXrActionCreateInfo.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
Returns a newXrActionCreateInfo.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
Create aXrActionCreateInfo.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
-
malloc
Returns a newXrActionCreateInfoinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
Returns a newXrActionCreateInfoinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
malloc
Returns a newXrActionCreateInfo.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
capacity- the buffer capacitystack- the stack from which to allocate
-
calloc
Returns a newXrActionCreateInfo.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
capacity- the buffer capacitystack- the stack from which to allocate
-
ntype
public static int ntype(long struct) Unsafe version oftype(). -
nnext
public static long nnext(long struct) Unsafe version ofnext(). -
nactionName
Unsafe version ofactionName(). -
nactionNameString
Unsafe version ofactionNameString(). -
nactionType
public static int nactionType(long struct) Unsafe version ofactionType(). -
ncountSubactionPaths
public static int ncountSubactionPaths(long struct) Unsafe version ofcountSubactionPaths(). -
nsubactionPaths
Unsafe version ofsubactionPaths. -
nlocalizedActionName
Unsafe version oflocalizedActionName(). -
nlocalizedActionNameString
Unsafe version oflocalizedActionNameString(). -
ntype
public static void ntype(long struct, int value) Unsafe version oftype. -
nnext
public static void nnext(long struct, long value) Unsafe version ofnext. -
nactionName
Unsafe version ofactionName. -
nactionType
public static void nactionType(long struct, int value) Unsafe version ofactionType. -
ncountSubactionPaths
public static void ncountSubactionPaths(long struct, int value) Sets the specified value to thecountSubactionPathsfield of the specifiedstruct. -
nsubactionPaths
Unsafe version ofsubactionPaths. -
nlocalizedActionName
Unsafe version oflocalizedActionName.
-