Class XrApplicationInfo

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

public class XrApplicationInfo extends org.lwjgl.system.Struct<XrApplicationInfo> implements org.lwjgl.system.NativeResource
Structure specifying application info.
Description

Useful values for apiVersion include API_VERSION_1_0 and API_VERSION_1_1.

Valid Usage (Implicit)
  • applicationName must be a null-terminated UTF-8 string whose length is less than or equal to MAX_APPLICATION_NAME_SIZE
  • engineName must be a null-terminated UTF-8 string whose length is less than or equal to MAX_ENGINE_NAME_SIZE
Note

When using the OpenXR API to implement a reusable engine that will be used by many applications, engineName should be set to a unique string that identifies the engine, and engineVersion should encode a representation of the engine’s version. This way, all applications that share this engine version will provide the same engineName and engineVersion to the runtime. The engine should then enable individual applications to choose their specific applicationName and applicationVersion, enabling one application to be distinguished from another application.

When using the OpenXR API to implement an individual application without a shared engine, the input engineName should be left empty and engineVersion should be set to 0. The applicationName should then be filled in with a unique string that identifies the app and the applicationVersion should encode a representation of the application’s version.

See Also

API_VERSION_1_0, API_VERSION_1_1, XrInstanceCreateInfo, CreateInstance

Layout


 struct XrApplicationInfo {
     char applicationName()[XR_MAX_APPLICATION_NAME_SIZE];
     uint32_t applicationVersion();
     char engineName()[XR_MAX_ENGINE_NAME_SIZE];
     uint32_t engineVersion();
     XrVersion apiVersion();
 }
  • Field Details

    • SIZEOF

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

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

      public static final int APPLICATIONNAME
      The struct member offsets.
    • APPLICATIONVERSION

      public static final int APPLICATIONVERSION
      The struct member offsets.
    • ENGINENAME

      public static final int ENGINENAME
      The struct member offsets.
    • ENGINEVERSION

      public static final int ENGINEVERSION
      The struct member offsets.
    • APIVERSION

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

    • XrApplicationInfo

      public XrApplicationInfo(ByteBuffer container)
      Creates a XrApplicationInfo 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<XrApplicationInfo>
    • applicationName

      public ByteBuffer applicationName()
      a non-empty string containing the name of the application.
    • applicationNameString

      public String applicationNameString()
      a non-empty string containing the name of the application.
    • applicationVersion

      public int applicationVersion()
      an unsigned integer variable containing the developer-supplied version number of the application.
    • engineName

      public ByteBuffer engineName()
      a string containing the name of the engine (if any) used to create the application. It may be empty to indicate no specified engine.
    • engineNameString

      public String engineNameString()
      a string containing the name of the engine (if any) used to create the application. It may be empty to indicate no specified engine.
    • engineVersion

      public int engineVersion()
      an unsigned integer variable containing the developer-supplied version number of the engine used to create the application. May be zero to indicate no specified engine.
    • apiVersion

      public long apiVersion()
      the version of this API against which the application will run, encoded as described in the API Version Numbers and Semantics section. If the runtime does not support the requested apiVersion it must return ERROR_API_VERSION_UNSUPPORTED.
    • applicationName

      public XrApplicationInfo applicationName(ByteBuffer value)
      Copies the specified encoded string to the applicationName() field.
    • applicationVersion

      public XrApplicationInfo applicationVersion(int value)
      Sets the specified value to the applicationVersion() field.
    • engineName

      public XrApplicationInfo engineName(ByteBuffer value)
      Copies the specified encoded string to the engineName() field.
    • engineVersion

      public XrApplicationInfo engineVersion(int value)
      Sets the specified value to the engineVersion() field.
    • apiVersion

      public XrApplicationInfo apiVersion(long value)
      Sets the specified value to the apiVersion() field.
    • set

      public XrApplicationInfo set(ByteBuffer applicationName, int applicationVersion, ByteBuffer engineName, int engineVersion, long apiVersion)
      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 XrApplicationInfo malloc()
      Returns a new XrApplicationInfo instance allocated with memAlloc. The instance must be explicitly freed.
    • calloc

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

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

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

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

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

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

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

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

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

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

      public static XrApplicationInfo calloc(org.lwjgl.system.MemoryStack stack)
      Returns a new XrApplicationInfo instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      stack - the stack from which to allocate
    • malloc

      public static XrApplicationInfo.Buffer malloc(int capacity, org.lwjgl.system.MemoryStack stack)
      Returns a new XrApplicationInfo.Buffer instance allocated on the specified MemoryStack.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • calloc

      public static XrApplicationInfo.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack)
      Returns a new XrApplicationInfo.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
    • napplicationName

      public static ByteBuffer napplicationName(long struct)
      Unsafe version of applicationName().
    • napplicationNameString

      public static String napplicationNameString(long struct)
      Unsafe version of applicationNameString().
    • napplicationVersion

      public static int napplicationVersion(long struct)
      Unsafe version of applicationVersion().
    • nengineName

      public static ByteBuffer nengineName(long struct)
      Unsafe version of engineName().
    • nengineNameString

      public static String nengineNameString(long struct)
      Unsafe version of engineNameString().
    • nengineVersion

      public static int nengineVersion(long struct)
      Unsafe version of engineVersion().
    • napiVersion

      public static long napiVersion(long struct)
      Unsafe version of apiVersion().
    • napplicationName

      public static void napplicationName(long struct, ByteBuffer value)
      Unsafe version of applicationName.
    • napplicationVersion

      public static void napplicationVersion(long struct, int value)
      Unsafe version of applicationVersion.
    • nengineName

      public static void nengineName(long struct, ByteBuffer value)
      Unsafe version of engineName.
    • nengineVersion

      public static void nengineVersion(long struct, int value)
      Unsafe version of engineVersion.
    • napiVersion

      public static void napiVersion(long struct, long value)
      Unsafe version of apiVersion.