public class NkBuffer
extends org.lwjgl.system.Struct
implements org.lwjgl.system.NativeResource
marker[2] – buffer marker to free a buffer to a certain offsetpool – allocator callback for dynamic bufferstype – memory management typememory – memory and size of the current memory blockgrow_factor – growing factor for dynamic memory managementallocated – total amount of memory allocatedneeded – totally consumed memory given that enough memory is presentcalls – number of allocation callssize – current size of the buffer
struct nk_buffer {
struct nk_buffer_marker marker[2];
struct nk_allocator pool;
enum nk_allocation_type type;
struct nk_memory memory;
float grow_factor;
nk_size allocated;
nk_size needed;
nk_size calls;
nk_size size;
}| Modifier and Type | Class and Description |
|---|---|
static class |
NkBuffer.Buffer
An array of
NkBuffer structs. |
| Modifier and Type | Field and Description |
|---|---|
static int |
ALIGNOF
The struct alignment in bytes.
|
static int |
ALLOCATED
The struct member offsets.
|
static int |
CALLS
The struct member offsets.
|
static int |
GROW_FACTOR
The struct member offsets.
|
static int |
MARKER
The struct member offsets.
|
static int |
MEMORY
The struct member offsets.
|
static int |
NEEDED
The struct member offsets.
|
static int |
POOL
The struct member offsets.
|
static int |
SIZE
The struct member offsets.
|
static int |
SIZEOF
The struct size in bytes.
|
static int |
TYPE
The struct member offsets.
|
| Constructor and Description |
|---|
NkBuffer(java.nio.ByteBuffer container)
Creates a
NkBuffer instance at the current position of the specified ByteBuffer container. |
| Modifier and Type | Method and Description |
|---|---|
long |
allocated()
Returns the value of the
allocated field. |
static NkBuffer |
calloc()
Returns a new
NkBuffer instance allocated with memCalloc. |
static NkBuffer.Buffer |
calloc(int capacity)
Returns a new
NkBuffer.Buffer instance allocated with memCalloc. |
static NkBuffer |
callocStack()
Returns a new
NkBuffer instance allocated on the thread-local MemoryStack and initializes all its bits to zero. |
static NkBuffer.Buffer |
callocStack(int capacity)
Returns a new
NkBuffer.Buffer instance allocated on the thread-local MemoryStack and initializes all its bits to zero. |
static NkBuffer.Buffer |
callocStack(int capacity,
org.lwjgl.system.MemoryStack stack)
Returns a new
NkBuffer.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero. |
static NkBuffer |
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a new
NkBuffer instance allocated on the specified MemoryStack and initializes all its bits to zero. |
long |
calls()
Returns the value of the
calls field. |
static NkBuffer |
create()
Returns a new
NkBuffer instance allocated with BufferUtils. |
static NkBuffer.Buffer |
create(int capacity)
Returns a new
NkBuffer.Buffer instance allocated with BufferUtils. |
static NkBuffer |
create(long address)
Returns a new
NkBuffer instance for the specified memory address. |
static NkBuffer.Buffer |
create(long address,
int capacity)
Create a
NkBuffer.Buffer instance at the specified memory. |
static NkBuffer |
createSafe(long address)
|
static NkBuffer.Buffer |
createSafe(long address,
int capacity)
|
float |
grow_factor()
Returns the value of the
grow_factor field. |
static NkBuffer |
malloc()
Returns a new
NkBuffer instance allocated with memAlloc. |
static NkBuffer.Buffer |
malloc(int capacity)
Returns a new
NkBuffer.Buffer instance allocated with memAlloc. |
static NkBuffer |
mallocStack()
Returns a new
NkBuffer instance allocated on the thread-local MemoryStack. |
static NkBuffer.Buffer |
mallocStack(int capacity)
Returns a new
NkBuffer.Buffer instance allocated on the thread-local MemoryStack. |
static NkBuffer.Buffer |
mallocStack(int capacity,
org.lwjgl.system.MemoryStack stack)
Returns a new
NkBuffer.Buffer instance allocated on the specified MemoryStack. |
static NkBuffer |
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a new
NkBuffer instance allocated on the specified MemoryStack. |
NkBufferMarker.Buffer |
marker()
Returns a
NkBufferMarker.Buffer view of the marker field. |
NkBufferMarker |
marker(int index)
Returns a
NkBufferMarker view of the struct at the specified index of the marker field. |
NkMemory |
memory()
Returns a
NkMemory view of the memory field. |
static long |
nallocated(long struct)
Unsafe version of
allocated(). |
static long |
ncalls(long struct)
Unsafe version of
calls(). |
long |
needed()
Returns the value of the
needed field. |
static float |
ngrow_factor(long struct)
Unsafe version of
grow_factor(). |
static NkBufferMarker.Buffer |
nmarker(long struct)
Unsafe version of
marker(). |
static NkBufferMarker |
nmarker(long struct,
int index)
Unsafe version of
marker. |
static NkMemory |
nmemory(long struct)
Unsafe version of
memory(). |
static long |
nneeded(long struct)
Unsafe version of
needed(). |
static NkAllocator |
npool(long struct)
Unsafe version of
pool(). |
static long |
nsize(long struct)
Unsafe version of
size(). |
static int |
ntype(long struct)
Unsafe version of
type(). |
NkAllocator |
pool()
Returns a
NkAllocator view of the pool field. |
long |
size()
Returns the value of the
size field. |
int |
sizeof() |
int |
type()
Returns the value of the
type field. |
public static final int SIZEOF
public static final int ALIGNOF
public static final int MARKER
public static final int POOL
public static final int TYPE
public static final int MEMORY
public static final int GROW_FACTOR
public static final int ALLOCATED
public static final int NEEDED
public static final int CALLS
public static final int SIZE
public NkBuffer(java.nio.ByteBuffer container)
NkBuffer 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.
public int sizeof()
sizeof in class org.lwjgl.system.Structpublic NkBufferMarker.Buffer marker()
NkBufferMarker.Buffer view of the marker field.public NkBufferMarker marker(int index)
NkBufferMarker view of the struct at the specified index of the marker field.public NkAllocator pool()
NkAllocator view of the pool field.public int type()
type field.public float grow_factor()
grow_factor field.public long allocated()
allocated field.public long needed()
needed field.public long calls()
calls field.public long size()
size field.public static NkBuffer malloc()
NkBuffer instance allocated with memAlloc. The instance must be explicitly freed.public static NkBuffer calloc()
NkBuffer instance allocated with memCalloc. The instance must be explicitly freed.public static NkBuffer create()
NkBuffer instance allocated with BufferUtils.public static NkBuffer create(long address)
NkBuffer instance for the specified memory address.@Nullable public static NkBuffer createSafe(long address)
public static NkBuffer.Buffer malloc(int capacity)
NkBuffer.Buffer instance allocated with memAlloc. The instance must be explicitly freed.capacity - the buffer capacitypublic static NkBuffer.Buffer calloc(int capacity)
NkBuffer.Buffer instance allocated with memCalloc. The instance must be explicitly freed.capacity - the buffer capacitypublic static NkBuffer.Buffer create(int capacity)
NkBuffer.Buffer instance allocated with BufferUtils.capacity - the buffer capacitypublic static NkBuffer.Buffer create(long address, int capacity)
NkBuffer.Buffer instance at the specified memory.address - the memory addresscapacity - the buffer capacity@Nullable public static NkBuffer.Buffer createSafe(long address, int capacity)
public static NkBuffer mallocStack()
NkBuffer instance allocated on the thread-local MemoryStack.public static NkBuffer callocStack()
NkBuffer instance allocated on the thread-local MemoryStack and initializes all its bits to zero.public static NkBuffer mallocStack(org.lwjgl.system.MemoryStack stack)
NkBuffer instance allocated on the specified MemoryStack.stack - the stack from which to allocatepublic static NkBuffer callocStack(org.lwjgl.system.MemoryStack stack)
NkBuffer instance allocated on the specified MemoryStack and initializes all its bits to zero.stack - the stack from which to allocatepublic static NkBuffer.Buffer mallocStack(int capacity)
NkBuffer.Buffer instance allocated on the thread-local MemoryStack.capacity - the buffer capacitypublic static NkBuffer.Buffer callocStack(int capacity)
NkBuffer.Buffer instance allocated on the thread-local MemoryStack and initializes all its bits to zero.capacity - the buffer capacitypublic static NkBuffer.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
NkBuffer.Buffer instance allocated on the specified MemoryStack.stack - the stack from which to allocatecapacity - the buffer capacitypublic static NkBuffer.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
NkBuffer.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.stack - the stack from which to allocatecapacity - the buffer capacitypublic static NkBufferMarker.Buffer nmarker(long struct)
marker().public static NkBufferMarker nmarker(long struct, int index)
marker.public static NkAllocator npool(long struct)
pool().public static int ntype(long struct)
type().public static float ngrow_factor(long struct)
grow_factor().public static long nallocated(long struct)
allocated().public static long nneeded(long struct)
needed().public static long ncalls(long struct)
calls().public static long nsize(long struct)
size().Copyright LWJGL. All Rights Reserved. License terms.