Class XrActionCreateInfo
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.openxr.XrActionCreateInfo
-
- All Implemented Interfaces:
java.lang.AutoCloseable,org.lwjgl.system.NativeResource,org.lwjgl.system.Pointer
public class XrActionCreateInfo extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResourceXrAction creation info.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
subactionPathsset to a list of paths. If this list of paths is omitted (i.e.subactionPathsis set toNULL, andcountSubactionPathsis 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
subactionPathsis specified and any of the following conditions are not satisfied, the runtime must returnERROR_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_UNSUPPORTEDin 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
actionNameorlocalizedActionNameare empty strings, the runtime must returnERROR_NAME_INVALIDorERROR_LOCALIZED_NAME_INVALIDrespectively. IfactionNameorlocalizedActionNameare duplicates of the corresponding field for any existing action in the specified action set, the runtime must returnERROR_NAME_DUPLICATEDorERROR_LOCALIZED_NAME_DUPLICATEDrespectively. If the conflicting action is destroyed, the conflicting field is no longer considered duplicated. IfactionNamecontains characters which are not allowed in a single level of a well-formed path string, the runtime must returnERROR_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 { XrStructureTypetype(); void const *next(); charactionName()[XR_MAX_ACTION_NAME_SIZE]; XrActionTypeactionType(); uint32_tcountSubactionPaths(); XrPath const *subactionPaths(); charlocalizedActionName()[XR_MAX_LOCALIZED_ACTION_NAME_SIZE]; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classXrActionCreateInfo.BufferAn array ofXrActionCreateInfostructs.
-
Field Summary
Fields Modifier and Type Field Description static intACTIONNAME
ACTIONTYPEThe struct member offsets.static intALIGNOFThe struct alignment in bytes.static intCOUNTSUBACTIONPATHS
LOCALIZEDACTIONNAME
NEXTThe struct member offsets.static intSIZEOFThe struct size in bytes.static intSUBACTIONPATHS
TYPEThe struct member offsets.
-
Constructor Summary
Constructors Constructor Description XrActionCreateInfo(java.nio.ByteBuffer container)Creates aXrActionCreateInfoinstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.nio.ByteBufferactionName()an array containing aNULLterminated string with the name of this action.XrActionCreateInfoactionName(java.nio.ByteBuffer value)Copies the specified encoded string to theactionName()field.java.lang.StringactionNameString()an array containing aNULLterminated string with the name of this action.intactionType()theXrActionTypeof the action to be created.XrActionCreateInfoactionType(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.intcountSubactionPaths()the number of elements in thesubactionPathsarray.XrActionCreateInfocountSubactionPaths(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 XrActionCreateInfocreateSafe(long address)static XrActionCreateInfo.BuffercreateSafe(long address, int capacity)java.nio.ByteBufferlocalizedActionName()an array containing aNULLterminatedUTF-8 string that can be presented to the user as a description of the action.XrActionCreateInfolocalizedActionName(java.nio.ByteBuffer value)Copies the specified encoded string to thelocalizedActionName()field.java.lang.StringlocalizedActionNameString()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 java.nio.ByteBuffernactionName(long struct)Unsafe version ofactionName().static voidnactionName(long struct, java.nio.ByteBuffer value)Unsafe version ofactionName.static java.lang.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.XrActionCreateInfonext(long value)Sets the specified value to thenext()field.static java.nio.ByteBuffernlocalizedActionName(long struct)Unsafe version oflocalizedActionName().static voidnlocalizedActionName(long struct, java.nio.ByteBuffer value)Unsafe version oflocalizedActionName.static java.lang.StringnlocalizedActionNameString(long struct)Unsafe version oflocalizedActionNameString().static longnnext(long struct)Unsafe version ofnext().static voidnnext(long struct, long value)Unsafe version ofnext.static java.nio.LongBuffernsubactionPaths(long struct)Unsafe version ofsubactionPaths.static voidnsubactionPaths(long struct, java.nio.LongBuffer value)Unsafe version ofsubactionPaths.static intntype(long struct)Unsafe version oftype().static voidntype(long struct, int value)Unsafe version oftype.XrActionCreateInfoset(int type, long next, java.nio.ByteBuffer actionName, int actionType, int countSubactionPaths, java.nio.LongBuffer subactionPaths, java.nio.ByteBuffer localizedActionName)Initializes this struct with the specified values.XrActionCreateInfoset(XrActionCreateInfo src)Copies the specified struct data to this struct.intsizeof()java.nio.LongBuffersubactionPaths()an array ofXrPathorNULL.XrActionCreateInfosubactionPaths(java.nio.LongBuffer value)Sets the address of the specifiedLongBufferto thesubactionPaths()field.inttype()theXrStructureTypeof this structure.XrActionCreateInfotype(int value)Sets the specified value to thetype()field.XrActionCreateInfotype$Default()Sets theTYPE_ACTION_CREATE_INFOvalue to thetype()field.
-
-
-
Constructor Detail
-
XrActionCreateInfo
public XrActionCreateInfo(java.nio.ByteBuffer container)
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 Detail
-
sizeof
public int sizeof()
- Specified by:
sizeofin classorg.lwjgl.system.Struct
-
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, actionNameString
public java.nio.ByteBuffer actionName() public java.lang.String 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
@Nullable public java.nio.LongBuffer 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, localizedActionNameString
public java.nio.ByteBuffer localizedActionName() public java.lang.String 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
public XrActionCreateInfo type(int value)
Sets the specified value to thetype()field.
-
type$Default
public XrActionCreateInfo type$Default()
Sets theTYPE_ACTION_CREATE_INFOvalue to thetype()field.
-
next
public XrActionCreateInfo next(long value)
Sets the specified value to thenext()field.
-
actionName
public XrActionCreateInfo actionName(java.nio.ByteBuffer value)
Copies the specified encoded string to theactionName()field.
-
actionType
public XrActionCreateInfo actionType(int value)
Sets the specified value to theactionType()field.
-
countSubactionPaths
public XrActionCreateInfo countSubactionPaths(int value)
Sets the specified value to thecountSubactionPaths()field.
-
subactionPaths
public XrActionCreateInfo subactionPaths(@Nullable java.nio.LongBuffer value)
Sets the address of the specifiedLongBufferto thesubactionPaths()field.
-
localizedActionName
public XrActionCreateInfo localizedActionName(java.nio.ByteBuffer value)
Copies the specified encoded string to thelocalizedActionName()field.
-
set
public XrActionCreateInfo set(int type, long next, java.nio.ByteBuffer actionName, int actionType, int countSubactionPaths, @Nullable java.nio.LongBuffer subactionPaths, java.nio.ByteBuffer localizedActionName)
Initializes this struct with the specified values.
-
set
public XrActionCreateInfo set(XrActionCreateInfo src)
Copies the specified struct data to this struct.- Parameters:
src- the source struct- Returns:
- this struct
-
malloc
public static XrActionCreateInfo malloc()
Returns a newXrActionCreateInfoinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static XrActionCreateInfo calloc()
Returns a newXrActionCreateInfoinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static XrActionCreateInfo create()
Returns a newXrActionCreateInfoinstance allocated withBufferUtils.
-
create
public static XrActionCreateInfo create(long address)
Returns a newXrActionCreateInfoinstance for the specified memory address.
-
createSafe
@Nullable public static XrActionCreateInfo createSafe(long address)
-
malloc
public static XrActionCreateInfo.Buffer malloc(int capacity)
Returns a newXrActionCreateInfo.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static XrActionCreateInfo.Buffer calloc(int capacity)
Returns a newXrActionCreateInfo.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static XrActionCreateInfo.Buffer create(int capacity)
Returns a newXrActionCreateInfo.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static XrActionCreateInfo.Buffer create(long address, int capacity)
Create aXrActionCreateInfo.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
@Nullable public static XrActionCreateInfo.Buffer createSafe(long address, int capacity)
-
malloc
public static XrActionCreateInfo malloc(org.lwjgl.system.MemoryStack stack)
Returns a newXrActionCreateInfoinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
public static XrActionCreateInfo calloc(org.lwjgl.system.MemoryStack stack)
Returns a newXrActionCreateInfoinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
malloc
public static XrActionCreateInfo.Buffer malloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newXrActionCreateInfo.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
calloc
public static XrActionCreateInfo.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newXrActionCreateInfo.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
ntype
public static int ntype(long struct)
Unsafe version oftype().
-
nnext
public static long nnext(long struct)
Unsafe version ofnext().
-
nactionName
public static java.nio.ByteBuffer nactionName(long struct)
Unsafe version ofactionName().
-
nactionNameString
public static java.lang.String nactionNameString(long struct)
Unsafe version ofactionNameString().
-
nactionType
public static int nactionType(long struct)
Unsafe version ofactionType().
-
ncountSubactionPaths
public static int ncountSubactionPaths(long struct)
Unsafe version ofcountSubactionPaths().
-
nsubactionPaths
@Nullable public static java.nio.LongBuffer nsubactionPaths(long struct)
Unsafe version ofsubactionPaths.
-
nlocalizedActionName
public static java.nio.ByteBuffer nlocalizedActionName(long struct)
Unsafe version oflocalizedActionName().
-
nlocalizedActionNameString
public static java.lang.String nlocalizedActionNameString(long struct)
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
public static void nactionName(long struct, java.nio.ByteBuffer value)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
public static void nsubactionPaths(long struct, @Nullable java.nio.LongBuffer value)Unsafe version ofsubactionPaths.
-
nlocalizedActionName
public static void nlocalizedActionName(long struct, java.nio.ByteBuffer value)Unsafe version oflocalizedActionName.
-
-