Class GLSLangVersion

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class GLSLangVersion extends Struct<GLSLangVersion> implements NativeResource

 struct glslang_version_t {
     int major;
     int minor;
     int patch;
     char const * flavor;
 }
  • Field Details

    • SIZEOF

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

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

      public static final int MAJOR
      The struct member offsets.
    • MINOR

      public static final int MINOR
      The struct member offsets.
    • PATCH

      public static final int PATCH
      The struct member offsets.
    • FLAVOR

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

    • GLSLangVersion

      public GLSLangVersion(ByteBuffer container)
      Creates a GLSLangVersion 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()
      Description copied from class: Struct
      Returns sizeof(struct).
      Specified by:
      sizeof in class Struct<GLSLangVersion>
    • major

      public int major()
      Returns:
      the value of the major field.
    • minor

      public int minor()
      Returns:
      the value of the minor field.
    • patch

      public int patch()
      Returns:
      the value of the patch field.
    • flavor

      public ByteBuffer flavor()
      Returns:
      a ByteBuffer view of the null-terminated string pointed to by the flavor field.
    • flavorString

      public String flavorString()
      Returns:
      the null-terminated string pointed to by the flavor field.
    • malloc

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

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

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

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

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

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

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

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

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

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

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

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

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

      public static GLSLangVersion.Buffer calloc(int capacity, MemoryStack stack)
      Returns a new GLSLangVersion.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
    • nmajor

      public static int nmajor(long struct)
      Unsafe version of major().
    • nminor

      public static int nminor(long struct)
      Unsafe version of minor().
    • npatch

      public static int npatch(long struct)
      Unsafe version of patch().
    • nflavor

      public static ByteBuffer nflavor(long struct)
      Unsafe version of flavor().
    • nflavorString

      public static String nflavorString(long struct)
      Unsafe version of flavorString().