Class MeshoptMeshlet

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class MeshoptMeshlet extends Struct<MeshoptMeshlet> implements NativeResource

 struct meshopt_Meshlet {
     unsigned int vertex_offset;
     unsigned int triangle_offset;
     unsigned int vertex_count;
     unsigned int triangle_count;
 }
  • Field Details

    • SIZEOF

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

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

      public static final int VERTEX_OFFSET
      The struct member offsets.
    • TRIANGLE_OFFSET

      public static final int TRIANGLE_OFFSET
      The struct member offsets.
    • VERTEX_COUNT

      public static final int VERTEX_COUNT
      The struct member offsets.
    • TRIANGLE_COUNT

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

    • MeshoptMeshlet

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

      public int vertex_offset()
      Returns:
      the value of the vertex_offset field.
    • triangle_offset

      public int triangle_offset()
      Returns:
      the value of the triangle_offset field.
    • vertex_count

      public int vertex_count()
      Returns:
      the value of the vertex_count field.
    • triangle_count

      public int triangle_count()
      Returns:
      the value of the triangle_count field.
    • malloc

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      public static int nvertex_offset(long struct)
      Unsafe version of vertex_offset().
    • ntriangle_offset

      public static int ntriangle_offset(long struct)
      Unsafe version of triangle_offset().
    • nvertex_count

      public static int nvertex_count(long struct)
      Unsafe version of vertex_count().
    • ntriangle_count

      public static int ntriangle_count(long struct)
      Unsafe version of triangle_count().