Class MeshoptStream

  • All Implemented Interfaces:
    java.lang.AutoCloseable, org.lwjgl.system.NativeResource, org.lwjgl.system.Pointer

    public class MeshoptStream
    extends org.lwjgl.system.Struct
    implements org.lwjgl.system.NativeResource
    Vertex attribute stream, similar to glVertexPointer.

    Each element takes size bytes, with stride controlling the spacing between successive elements.

    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  MeshoptStream.Buffer
      An array of MeshoptStream structs.
      • Nested classes/interfaces inherited from interface org.lwjgl.system.Pointer

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

        org.lwjgl.system.Struct.StructValidation
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int ALIGNOF
      The struct alignment in bytes.
      static int DATA
      SIZE
      The struct member offsets.
      static int SIZEOF
      The struct size in bytes.
      static int STRIDE
      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
      MeshoptStream​(java.nio.ByteBuffer container)
      Creates a MeshoptStream instance at the current position of the specified ByteBuffer container.
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • DATA, SIZE, STRIDE

        The struct member offsets.
    • Constructor Detail

      • MeshoptStream

        public MeshoptStream​(java.nio.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 Detail

      • sizeof

        public int sizeof()
        Specified by:
        sizeof in class org.lwjgl.system.Struct
      • data

        public java.nio.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​(java.nio.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​(java.nio.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

        @Nullable
        public static 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​(long address,
                                                  int capacity)
        Create a MeshoptStream.Buffer instance at the specified memory.
        Parameters:
        address - the memory address
        capacity - the buffer capacity
      • createSafe

        @Nullable
        public static 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:
        stack - the stack from which to allocate
        capacity - the buffer capacity
      • 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:
        stack - the stack from which to allocate
        capacity - the buffer capacity
      • ndata

        public static java.nio.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,
                                 java.nio.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