Package org.lwjgl.bgfx
Class BGFXInstanceDataBuffer
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.bgfx.BGFXInstanceDataBuffer
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,org.lwjgl.system.NativeResource
,org.lwjgl.system.Pointer
public class BGFXInstanceDataBuffer extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResource
Instance data buffer info.Member documentation
data
– pointer to datasize
– data sizeoffset
– offset in vertex buffernum
– number of instancesstride
– vertex stridehandle
– vertex buffer object handle
Layout
struct bgfx_instance_data_buffer_t { uint8_t * data; uint32_t size; uint32_t offset; uint32_t num; uint16_t stride; bgfx_vertex_buffer_handle_t handle; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BGFXInstanceDataBuffer.Buffer
An array ofBGFXInstanceDataBuffer
structs.
-
Constructor Summary
Constructors Constructor Description BGFXInstanceDataBuffer(java.nio.ByteBuffer container)
Creates aBGFXInstanceDataBuffer
instance at the current position of the specifiedByteBuffer
container.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static BGFXInstanceDataBuffer
calloc()
Returns a newBGFXInstanceDataBuffer
instance allocated withmemCalloc
.static BGFXInstanceDataBuffer.Buffer
calloc(int capacity)
Returns a newBGFXInstanceDataBuffer.Buffer
instance allocated withmemCalloc
.static BGFXInstanceDataBuffer
callocStack()
Returns a newBGFXInstanceDataBuffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static BGFXInstanceDataBuffer.Buffer
callocStack(int capacity)
Returns a newBGFXInstanceDataBuffer.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static BGFXInstanceDataBuffer.Buffer
callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newBGFXInstanceDataBuffer.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static BGFXInstanceDataBuffer
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newBGFXInstanceDataBuffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static BGFXInstanceDataBuffer
create()
Returns a newBGFXInstanceDataBuffer
instance allocated withBufferUtils
.static BGFXInstanceDataBuffer.Buffer
create(int capacity)
Returns a newBGFXInstanceDataBuffer.Buffer
instance allocated withBufferUtils
.static BGFXInstanceDataBuffer
create(long address)
Returns a newBGFXInstanceDataBuffer
instance for the specified memory address.static BGFXInstanceDataBuffer.Buffer
create(long address, int capacity)
Create aBGFXInstanceDataBuffer.Buffer
instance at the specified memory.static BGFXInstanceDataBuffer
createSafe(long address)
static BGFXInstanceDataBuffer.Buffer
createSafe(long address, int capacity)
java.nio.ByteBuffer
data()
Returns aByteBuffer
view of the data pointed to by thedata
field.BGFXInstanceDataBuffer
data(java.nio.ByteBuffer value)
Sets the address of the specifiedByteBuffer
to thedata
field.short
handle()
Returns the value of thehandle
field.BGFXInstanceDataBuffer
handle(short value)
Sets the specified value to thehandle
field.static BGFXInstanceDataBuffer
malloc()
Returns a newBGFXInstanceDataBuffer
instance allocated withmemAlloc
.static BGFXInstanceDataBuffer.Buffer
malloc(int capacity)
Returns a newBGFXInstanceDataBuffer.Buffer
instance allocated withmemAlloc
.static BGFXInstanceDataBuffer
mallocStack()
Returns a newBGFXInstanceDataBuffer
instance allocated on the thread-localMemoryStack
.static BGFXInstanceDataBuffer.Buffer
mallocStack(int capacity)
Returns a newBGFXInstanceDataBuffer.Buffer
instance allocated on the thread-localMemoryStack
.static BGFXInstanceDataBuffer.Buffer
mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newBGFXInstanceDataBuffer.Buffer
instance allocated on the specifiedMemoryStack
.static BGFXInstanceDataBuffer
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newBGFXInstanceDataBuffer
instance allocated on the specifiedMemoryStack
.static java.nio.ByteBuffer
ndata(long struct)
Unsafe version ofdata
.static void
ndata(long struct, java.nio.ByteBuffer value)
Unsafe version ofdata
.static short
nhandle(long struct)
Unsafe version ofhandle()
.static void
nhandle(long struct, short value)
Unsafe version ofhandle
.static int
nnum(long struct)
Unsafe version ofnum()
.static void
nnum(long struct, int value)
Unsafe version ofnum
.static int
noffset(long struct)
Unsafe version ofoffset()
.static void
noffset(long struct, int value)
Unsafe version ofoffset
.static int
nsize(long struct)
Unsafe version ofsize()
.static void
nsize(long struct, int value)
Sets the specified value to thesize
field of the specifiedstruct
.static short
nstride(long struct)
Unsafe version ofstride()
.static void
nstride(long struct, short value)
Unsafe version ofstride
.int
num()
Returns the value of thenum
field.BGFXInstanceDataBuffer
num(int value)
Sets the specified value to thenum
field.int
offset()
Returns the value of theoffset
field.BGFXInstanceDataBuffer
offset(int value)
Sets the specified value to theoffset
field.BGFXInstanceDataBuffer
set(java.nio.ByteBuffer data, int offset, int num, short stride, short handle)
Initializes this struct with the specified values.BGFXInstanceDataBuffer
set(BGFXInstanceDataBuffer src)
Copies the specified struct data to this struct.int
size()
Returns the value of thesize
field.int
sizeof()
short
stride()
Returns the value of thestride
field.BGFXInstanceDataBuffer
stride(short value)
Sets the specified value to thestride
field.static void
validate(long struct)
Validates pointer members that should not beNULL
.static void
validate(long array, int count)
Callsvalidate(long)
for each struct contained in the specified struct array.
-
-
-
Constructor Detail
-
BGFXInstanceDataBuffer
public BGFXInstanceDataBuffer(java.nio.ByteBuffer container)
Creates aBGFXInstanceDataBuffer
instance at the current position of the specifiedByteBuffer
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 classorg.lwjgl.system.Struct
-
data
public java.nio.ByteBuffer data()
Returns aByteBuffer
view of the data pointed to by thedata
field.
-
size
public int size()
Returns the value of thesize
field.
-
offset
public int offset()
Returns the value of theoffset
field.
-
num
public int num()
Returns the value of thenum
field.
-
stride
public short stride()
Returns the value of thestride
field.
-
handle
public short handle()
Returns the value of thehandle
field.
-
data
public BGFXInstanceDataBuffer data(java.nio.ByteBuffer value)
Sets the address of the specifiedByteBuffer
to thedata
field.
-
offset
public BGFXInstanceDataBuffer offset(int value)
Sets the specified value to theoffset
field.
-
num
public BGFXInstanceDataBuffer num(int value)
Sets the specified value to thenum
field.
-
stride
public BGFXInstanceDataBuffer stride(short value)
Sets the specified value to thestride
field.
-
handle
public BGFXInstanceDataBuffer handle(short value)
Sets the specified value to thehandle
field.
-
set
public BGFXInstanceDataBuffer set(java.nio.ByteBuffer data, int offset, int num, short stride, short handle)
Initializes this struct with the specified values.
-
set
public BGFXInstanceDataBuffer set(BGFXInstanceDataBuffer src)
Copies the specified struct data to this struct.- Parameters:
src
- the source struct- Returns:
- this struct
-
malloc
public static BGFXInstanceDataBuffer malloc()
Returns a newBGFXInstanceDataBuffer
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static BGFXInstanceDataBuffer calloc()
Returns a newBGFXInstanceDataBuffer
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static BGFXInstanceDataBuffer create()
Returns a newBGFXInstanceDataBuffer
instance allocated withBufferUtils
.
-
create
public static BGFXInstanceDataBuffer create(long address)
Returns a newBGFXInstanceDataBuffer
instance for the specified memory address.
-
createSafe
@Nullable public static BGFXInstanceDataBuffer createSafe(long address)
-
malloc
public static BGFXInstanceDataBuffer.Buffer malloc(int capacity)
Returns a newBGFXInstanceDataBuffer.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static BGFXInstanceDataBuffer.Buffer calloc(int capacity)
Returns a newBGFXInstanceDataBuffer.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static BGFXInstanceDataBuffer.Buffer create(int capacity)
Returns a newBGFXInstanceDataBuffer.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static BGFXInstanceDataBuffer.Buffer create(long address, int capacity)
Create aBGFXInstanceDataBuffer.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
createSafe
@Nullable public static BGFXInstanceDataBuffer.Buffer createSafe(long address, int capacity)
-
mallocStack
public static BGFXInstanceDataBuffer mallocStack()
Returns a newBGFXInstanceDataBuffer
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static BGFXInstanceDataBuffer callocStack()
Returns a newBGFXInstanceDataBuffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static BGFXInstanceDataBuffer mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newBGFXInstanceDataBuffer
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static BGFXInstanceDataBuffer callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newBGFXInstanceDataBuffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
mallocStack
public static BGFXInstanceDataBuffer.Buffer mallocStack(int capacity)
Returns a newBGFXInstanceDataBuffer.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static BGFXInstanceDataBuffer.Buffer callocStack(int capacity)
Returns a newBGFXInstanceDataBuffer.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.- Parameters:
capacity
- the buffer capacity
-
mallocStack
public static BGFXInstanceDataBuffer.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newBGFXInstanceDataBuffer.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
callocStack
public static BGFXInstanceDataBuffer.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newBGFXInstanceDataBuffer.Buffer
instance allocated on the specifiedMemoryStack
and 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)
Unsafe version ofdata
.
-
nsize
public static int nsize(long struct)
Unsafe version ofsize()
.
-
noffset
public static int noffset(long struct)
Unsafe version ofoffset()
.
-
nnum
public static int nnum(long struct)
Unsafe version ofnum()
.
-
nstride
public static short nstride(long struct)
Unsafe version ofstride()
.
-
nhandle
public static short nhandle(long struct)
Unsafe version ofhandle()
.
-
ndata
public static void ndata(long struct, java.nio.ByteBuffer value)
Unsafe version ofdata
.
-
nsize
public static void nsize(long struct, int value)
Sets the specified value to thesize
field of the specifiedstruct
.
-
noffset
public static void noffset(long struct, int value)
Unsafe version ofoffset
.
-
nnum
public static void nnum(long struct, int value)
Unsafe version ofnum
.
-
nstride
public static void nstride(long struct, short value)
Unsafe version ofstride
.
-
nhandle
public static void nhandle(long struct, short value)
Unsafe version ofhandle
.
-
validate
public static void validate(long struct)
Validates pointer members that should not beNULL
.- Parameters:
struct
- the struct to validate
-
validate
public static void validate(long array, int count)
Callsvalidate(long)
for each struct contained in the specified struct array.- Parameters:
array
- the struct array to validatecount
- the number of structs inarray
-
-