Class XrActionCreateInfo

java.lang.Object
org.lwjgl.system.Pointer.Default
org.lwjgl.system.Struct<XrActionCreateInfo>
org.lwjgl.openxr.XrActionCreateInfo
All Implemented Interfaces:
AutoCloseable, org.lwjgl.system.NativeResource, org.lwjgl.system.Pointer

public class XrActionCreateInfo extends org.lwjgl.system.Struct<XrActionCreateInfo> 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 Details

    • SIZEOF

      public static final int SIZEOF
      The struct size in bytes.
    • ALIGNOF

      public static final int ALIGNOF
      The struct alignment in bytes.
    • TYPE

      public static final int TYPE
      The struct member offsets.
    • NEXT

      public static final int NEXT
      The struct member offsets.
    • ACTIONNAME

      public static final int ACTIONNAME
      The struct member offsets.
    • ACTIONTYPE

      public static final int ACTIONTYPE
      The struct member offsets.
    • COUNTSUBACTIONPATHS

      public static final int COUNTSUBACTIONPATHS
      The struct member offsets.
    • SUBACTIONPATHS

      public static final int SUBACTIONPATHS
      The struct member offsets.
    • LOCALIZEDACTIONNAME

      public static final int LOCALIZEDACTIONNAME
      The struct member offsets.
  • Constructor Details

    • XrActionCreateInfo

      public XrActionCreateInfo(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 Details

    • sizeof

      public int sizeof()
      Specified by:
      sizeof in class org.lwjgl.system.Struct<XrActionCreateInfo>
    • 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

      public ByteBuffer actionName()
      an array containing a NULL terminated string with the name of this action.
    • actionNameString

      public 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

      public @Nullable 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

      public ByteBuffer localizedActionName()
      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.
    • localizedActionNameString

      public 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.
    • type

      public XrActionCreateInfo type(int value)
      Sets the specified value to the type() field.
    • type$Default

      public XrActionCreateInfo type$Default()
      Sets the TYPE_ACTION_CREATE_INFO value to the type() field.
    • next

      public XrActionCreateInfo next(long value)
      Sets the specified value to the next() field.
    • actionName

      public XrActionCreateInfo actionName(ByteBuffer value)
      Copies the specified encoded string to the actionName() field.
    • actionType

      public XrActionCreateInfo actionType(int value)
      Sets the specified value to the actionType() field.
    • countSubactionPaths

      public XrActionCreateInfo countSubactionPaths(int value)
      Sets the specified value to the countSubactionPaths() field.
    • subactionPaths

      public XrActionCreateInfo subactionPaths(@Nullable LongBuffer value)
      Sets the address of the specified LongBuffer to the subactionPaths() field.
    • localizedActionName

      public XrActionCreateInfo localizedActionName(ByteBuffer value)
      Copies the specified encoded string to the localizedActionName() 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

      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

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

      public static XrActionCreateInfo.Buffer malloc(int capacity)
      Returns a new XrActionCreateInfo.Buffer instance allocated with memAlloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • calloc

      public static XrActionCreateInfo.Buffer calloc(int capacity)
      Returns a new XrActionCreateInfo.Buffer instance allocated with memCalloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • create

      public static XrActionCreateInfo.Buffer create(int capacity)
      Returns a new XrActionCreateInfo.Buffer instance allocated with BufferUtils.
      Parameters:
      capacity - the buffer capacity
    • create

      public static XrActionCreateInfo.Buffer create(long address, int capacity)
      Create a XrActionCreateInfo.Buffer instance at the specified memory.
      Parameters:
      address - the memory address
      capacity - the buffer capacity
    • createSafe

      public static @Nullable 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:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • 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:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • 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 ByteBuffer nactionName(long struct)
      Unsafe version of actionName().
    • nactionNameString

      public static 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

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

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

      public static 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, 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 LongBuffer value)
      Unsafe version of subactionPaths.
    • nlocalizedActionName

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