Class MeshoptStream

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class MeshoptStream extends Struct<MeshoptStream> implements NativeResource

 struct meshopt_Stream {
     void const * data;
     size_t size;
     size_t stride;
 }
  • Field Details

    • SIZEOF

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

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

      public static final int DATA
      The struct member offsets.
    • SIZE

      public static final int SIZE
      The struct member offsets.
    • STRIDE

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

    • MeshoptStream

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

      public ByteBuffer data(int capacity)
      Returns:
      a ByteBuffer view of the data pointed to by the data field.
    • size

      public long size()
      Returns:
      the value of the size field.
    • stride

      public long stride()
      Returns:
      the value of the stride field.
    • data

      public MeshoptStream data(ByteBuffer value)
      Sets the address of the specified ByteBuffer to the data field.
    • size

      public MeshoptStream size(long value)
      Sets the specified value to the size field.
    • stride

      public MeshoptStream stride(long value)
      Sets the specified value to the stride field.
    • set

      public MeshoptStream set(ByteBuffer data, long size, long stride)
      Initializes this struct with the specified values.
    • set

      public MeshoptStream set(MeshoptStream src)
      Copies the specified struct data to this struct.
      Parameters:
      src - the source struct
      Returns:
      this struct
    • malloc

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      public static ByteBuffer ndata(long struct, int capacity)
      Unsafe version of data.
    • nsize

      public static long nsize(long struct)
      Unsafe version of size().
    • nstride

      public static long nstride(long struct)
      Unsafe version of stride().
    • ndata

      public static void ndata(long struct, ByteBuffer value)
      Unsafe version of data.
    • nsize

      public static void nsize(long struct, long value)
      Unsafe version of size.
    • nstride

      public static void nstride(long struct, long value)
      Unsafe version of stride.
    • validate

      public static void validate(long struct)
      Validates pointer members that should not be NULL.
      Parameters:
      struct - the struct to validate