Class MeshoptStream

java.lang.Object
org.lwjgl.system.Pointer.Default
org.lwjgl.system.Struct<MeshoptStream>
org.lwjgl.util.meshoptimizer.MeshoptStream
All Implemented Interfaces:
AutoCloseable, org.lwjgl.system.NativeResource, org.lwjgl.system.Pointer

public class MeshoptStream extends org.lwjgl.system.Struct<MeshoptStream> implements org.lwjgl.system.NativeResource
Vertex attribute stream.

Each element takes size bytes, beginning at data, with stride controlling the spacing between successive elements (stridesize).

Layout


 struct meshopt_Stream {
     void const * data;
     size_t size;
     size_t stride;
 }
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    An array of MeshoptStream structs.

    Nested classes/interfaces inherited from class org.lwjgl.system.Struct

    org.lwjgl.system.Struct.StructValidation

    Nested classes/interfaces inherited from interface org.lwjgl.system.Pointer

    org.lwjgl.system.Pointer.Default
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    The struct alignment in bytes.
    static final int
    The struct member offsets.
    static final int
    The struct member offsets.
    static final int
    The struct size in bytes.
    static final int
    The struct member offsets.

    Fields inherited from interface org.lwjgl.system.Pointer

    BITS32, BITS64, CLONG_SHIFT, CLONG_SIZE, POINTER_SHIFT, POINTER_SIZE
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a MeshoptStream instance at the current position of the specified ByteBuffer container.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns a new MeshoptStream instance allocated with memCalloc.
    calloc(int capacity)
    Returns a new MeshoptStream.Buffer instance allocated with memCalloc.
    calloc(int capacity, org.lwjgl.system.MemoryStack stack)
    Returns a new MeshoptStream.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
    calloc(org.lwjgl.system.MemoryStack stack)
    Returns a new MeshoptStream instance allocated on the specified MemoryStack and initializes all its bits to zero.
    Returns a new MeshoptStream instance allocated with BufferUtils.
    create(int capacity)
    Returns a new MeshoptStream.Buffer instance allocated with BufferUtils.
    create(long address)
    Returns a new MeshoptStream instance for the specified memory address.
    create(long address, int capacity)
    Create a MeshoptStream.Buffer instance at the specified memory.
    static @Nullable MeshoptStream
    createSafe(long address)
    Like create, but returns null if address is NULL.
    static @Nullable MeshoptStream.Buffer
    createSafe(long address, int capacity)
    Like create, but returns null if address is NULL.
    data(int capacity)
     
    Sets the address of the specified ByteBuffer to the data field.
    Returns a new MeshoptStream instance allocated with memAlloc.
    malloc(int capacity)
    Returns a new MeshoptStream.Buffer instance allocated with memAlloc.
    malloc(int capacity, org.lwjgl.system.MemoryStack stack)
    Returns a new MeshoptStream.Buffer instance allocated on the specified MemoryStack.
    malloc(org.lwjgl.system.MemoryStack stack)
    Returns a new MeshoptStream instance allocated on the specified MemoryStack.
    static ByteBuffer
    ndata(long struct, int capacity)
    Unsafe version of data.
    static void
    ndata(long struct, ByteBuffer value)
    Unsafe version of data.
    static long
    nsize(long struct)
    Unsafe version of size().
    static void
    nsize(long struct, long value)
    Unsafe version of size.
    static long
    nstride(long struct)
    Unsafe version of stride().
    static void
    nstride(long struct, long value)
    Unsafe version of stride.
    set(ByteBuffer data, long size, long stride)
    Initializes this struct with the specified values.
    Copies the specified struct data to this struct.
    long
     
    size(long value)
    Sets the specified value to the size field.
    int
     
    long
     
    stride(long value)
    Sets the specified value to the stride field.
    static void
    validate(long struct)
    Validates pointer members that should not be NULL.

    Methods inherited from class org.lwjgl.system.Struct

    clear, free, isNull, validate, validate

    Methods inherited from class org.lwjgl.system.Pointer.Default

    address, equals, hashCode, toString

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.lwjgl.system.NativeResource

    close, free
  • 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()
      Specified by:
      sizeof in class org.lwjgl.system.Struct<MeshoptStream>
    • data

      public ByteBuffer data(int capacity)
      Parameters:
      capacity - the number of elements in the returned buffer
      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(org.lwjgl.system.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(org.lwjgl.system.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, org.lwjgl.system.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, org.lwjgl.system.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