Package org.lwjgl.util.meshoptimizer
Class MeshoptStream
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.util.meshoptimizer.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.NativeResourceVertex attribute stream, similar toglVertexPointer.Each element takes
sizebytes, withstridecontrolling 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 classMeshoptStream.BufferAn array ofMeshoptStreamstructs.
-
Constructor Summary
Constructors Constructor Description MeshoptStream(java.nio.ByteBuffer container)Creates aMeshoptStreaminstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static MeshoptStreamcalloc()Returns a newMeshoptStreaminstance allocated withmemCalloc.static MeshoptStream.Buffercalloc(int capacity)Returns a newMeshoptStream.Bufferinstance allocated withmemCalloc.static MeshoptStream.Buffercalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newMeshoptStream.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static MeshoptStreamcalloc(org.lwjgl.system.MemoryStack stack)Returns a newMeshoptStreaminstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static MeshoptStreamcreate()Returns a newMeshoptStreaminstance allocated withBufferUtils.static MeshoptStream.Buffercreate(int capacity)Returns a newMeshoptStream.Bufferinstance allocated withBufferUtils.static MeshoptStreamcreate(long address)Returns a newMeshoptStreaminstance for the specified memory address.static MeshoptStream.Buffercreate(long address, int capacity)Create aMeshoptStream.Bufferinstance at the specified memory.static MeshoptStreamcreateSafe(long address)static MeshoptStream.BuffercreateSafe(long address, int capacity)java.nio.ByteBufferdata(int capacity)MeshoptStreamdata(java.nio.ByteBuffer value)Sets the address of the specifiedByteBufferto thedatafield.static MeshoptStreammalloc()Returns a newMeshoptStreaminstance allocated withmemAlloc.static MeshoptStream.Buffermalloc(int capacity)Returns a newMeshoptStream.Bufferinstance allocated withmemAlloc.static MeshoptStream.Buffermalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newMeshoptStream.Bufferinstance allocated on the specifiedMemoryStack.static MeshoptStreammalloc(org.lwjgl.system.MemoryStack stack)Returns a newMeshoptStreaminstance allocated on the specifiedMemoryStack.static java.nio.ByteBufferndata(long struct, int capacity)Unsafe version ofdata.static voidndata(long struct, java.nio.ByteBuffer value)Unsafe version ofdata.static longnsize(long struct)Unsafe version ofsize().static voidnsize(long struct, long value)Unsafe version ofsize.static longnstride(long struct)Unsafe version ofstride().static voidnstride(long struct, long value)Unsafe version ofstride.MeshoptStreamset(java.nio.ByteBuffer data, long size, long stride)Initializes this struct with the specified values.MeshoptStreamset(MeshoptStream src)Copies the specified struct data to this struct.longsize()MeshoptStreamsize(long value)Sets the specified value to thesizefield.intsizeof()longstride()MeshoptStreamstride(long value)Sets the specified value to thestridefield.static voidvalidate(long struct)Validates pointer members that should not beNULL.
-
-
-
Constructor Detail
-
MeshoptStream
public MeshoptStream(java.nio.ByteBuffer container)
Creates aMeshoptStreaminstance at the current position of the specifiedByteBuffercontainer. 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:
sizeofin classorg.lwjgl.system.Struct
-
data
public java.nio.ByteBuffer data(int capacity)
- Parameters:
capacity- the number of elements in the returned buffer- Returns:
- a
ByteBufferview of the data pointed to by thedatafield.
-
size
public long size()
- Returns:
- the value of the
sizefield.
-
stride
public long stride()
- Returns:
- the value of the
stridefield.
-
data
public MeshoptStream data(java.nio.ByteBuffer value)
Sets the address of the specifiedByteBufferto thedatafield.
-
size
public MeshoptStream size(long value)
Sets the specified value to thesizefield.
-
stride
public MeshoptStream stride(long value)
Sets the specified value to thestridefield.
-
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 newMeshoptStreaminstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static MeshoptStream calloc()
Returns a newMeshoptStreaminstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static MeshoptStream create()
Returns a newMeshoptStreaminstance allocated withBufferUtils.
-
create
public static MeshoptStream create(long address)
Returns a newMeshoptStreaminstance for the specified memory address.
-
createSafe
@Nullable public static MeshoptStream createSafe(long address)
-
malloc
public static MeshoptStream.Buffer malloc(int capacity)
Returns a newMeshoptStream.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static MeshoptStream.Buffer calloc(int capacity)
Returns a newMeshoptStream.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static MeshoptStream.Buffer create(int capacity)
Returns a newMeshoptStream.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static MeshoptStream.Buffer create(long address, int capacity)
Create aMeshoptStream.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
@Nullable public static MeshoptStream.Buffer createSafe(long address, int capacity)
-
malloc
public static MeshoptStream malloc(org.lwjgl.system.MemoryStack stack)
Returns a newMeshoptStreaminstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
public static MeshoptStream calloc(org.lwjgl.system.MemoryStack stack)
Returns a newMeshoptStreaminstance allocated on the specifiedMemoryStackand 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 newMeshoptStream.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
calloc
public static MeshoptStream.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newMeshoptStream.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
ndata
public static java.nio.ByteBuffer ndata(long struct, int capacity)Unsafe version ofdata.
-
nsize
public static long nsize(long struct)
Unsafe version ofsize().
-
nstride
public static long nstride(long struct)
Unsafe version ofstride().
-
ndata
public static void ndata(long struct, java.nio.ByteBuffer value)Unsafe version ofdata.
-
nsize
public static void nsize(long struct, long value)Unsafe version ofsize.
-
nstride
public static void nstride(long struct, long value)Unsafe version ofstride.
-
validate
public static void validate(long struct)
Validates pointer members that should not beNULL.- Parameters:
struct- the struct to validate
-
-