Class 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.NativeResource
    XrAction 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 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)
    See Also

    CreateAction, CreateActionSet

    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];
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • TYPE, NEXT, ACTIONNAME, ACTIONTYPE, COUNTSUBACTIONPATHS, SUBACTIONPATHS, LOCALIZEDACTIONNAME

        The struct member offsets.
    • Constructor Detail

      • XrActionCreateInfo

        public XrActionCreateInfo​(java.nio.ByteBuffer container)
        Creates a XrActionCreateInfo instance at the current position of the specified ByteBuffer container. 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:
        sizeof in class org.lwjgl.system.Struct
      • type

        public int type()
        the XrStructureType of this structure.
      • next

        public long next()
        NULL or 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 a NULL terminated string with the name of this action.
      • actionType

        public int actionType()
        the XrActionType of the action to be created.
      • countSubactionPaths

        public int countSubactionPaths()
        the number of elements in the subactionPaths array. If subactionPaths is NULL, this parameter must be 0.
      • subactionPaths

        @Nullable
        public java.nio.LongBuffer subactionPaths()
        an array of XrPath or NULL. 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 a NULL terminated UTF-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.
      • subactionPaths

        public XrActionCreateInfo subactionPaths​(@Nullable
                                                 java.nio.LongBuffer value)
        Sets the address of the specified LongBuffer to the subactionPaths() 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.
      • malloc

        public static XrActionCreateInfo malloc()
        Returns a new XrActionCreateInfo instance allocated with memAlloc. The instance must be explicitly freed.
      • calloc

        public static XrActionCreateInfo calloc()
        Returns a new XrActionCreateInfo instance allocated with memCalloc. The instance must be explicitly freed.
      • create

        public static XrActionCreateInfo create()
        Returns a new XrActionCreateInfo instance allocated with BufferUtils.
      • create

        public static XrActionCreateInfo create​(long address)
        Returns a new XrActionCreateInfo instance for the specified memory address.
      • createSafe

        @Nullable
        public static XrActionCreateInfo createSafe​(long address)
        Like create, but returns null if address is NULL.
      • createSafe

        @Nullable
        public static XrActionCreateInfo.Buffer createSafe​(long address,
                                                           int capacity)
        Like create, but returns null if address is NULL.
      • malloc

        public static XrActionCreateInfo malloc​(org.lwjgl.system.MemoryStack stack)
        Returns a new XrActionCreateInfo instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
      • calloc

        public static XrActionCreateInfo calloc​(org.lwjgl.system.MemoryStack stack)
        Returns a new XrActionCreateInfo instance allocated on the specified MemoryStack and 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 new XrActionCreateInfo.Buffer instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
        capacity - the buffer capacity
      • calloc

        public static XrActionCreateInfo.Buffer calloc​(int capacity,
                                                       org.lwjgl.system.MemoryStack stack)
        Returns a new XrActionCreateInfo.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
        capacity - the buffer capacity
      • ntype

        public static int ntype​(long struct)
        Unsafe version of type().
      • nnext

        public static long nnext​(long struct)
        Unsafe version of next().
      • nactionName

        public static java.nio.ByteBuffer nactionName​(long struct)
        Unsafe version of actionName().
      • nactionNameString

        public static java.lang.String nactionNameString​(long struct)
        Unsafe version of actionNameString().
      • nactionType

        public static int nactionType​(long struct)
        Unsafe version of actionType().
      • ncountSubactionPaths

        public static int ncountSubactionPaths​(long struct)
        Unsafe version of countSubactionPaths().
      • nsubactionPaths

        @Nullable
        public static java.nio.LongBuffer nsubactionPaths​(long struct)
        Unsafe version of subactionPaths.
      • nlocalizedActionName

        public static java.nio.ByteBuffer nlocalizedActionName​(long struct)
        Unsafe version of localizedActionName().
      • nlocalizedActionNameString

        public static java.lang.String nlocalizedActionNameString​(long struct)
        Unsafe version of localizedActionNameString().
      • ntype

        public static void ntype​(long struct,
                                 int value)
        Unsafe version of type.
      • nnext

        public static void nnext​(long struct,
                                 long value)
        Unsafe version of next.
      • nactionName

        public static void nactionName​(long struct,
                                       java.nio.ByteBuffer value)
        Unsafe version of actionName.
      • nactionType

        public static void nactionType​(long struct,
                                       int value)
        Unsafe version of actionType.
      • ncountSubactionPaths

        public static void ncountSubactionPaths​(long struct,
                                                int value)
        Sets the specified value to the countSubactionPaths field of the specified struct.
      • nsubactionPaths

        public static void nsubactionPaths​(long struct,
                                           @Nullable
                                           java.nio.LongBuffer value)
        Unsafe version of subactionPaths.
      • nlocalizedActionName

        public static void nlocalizedActionName​(long struct,
                                                java.nio.ByteBuffer value)
        Unsafe version of localizedActionName.