Package org.lwjgl.nuklear
Class NkBuffer
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.nuklear.NkBuffer
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,org.lwjgl.system.NativeResource
,org.lwjgl.system.Pointer
public class NkBuffer extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResource
Member documentation
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
Layout
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; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
NkBuffer.Buffer
An array ofNkBuffer
structs.
-
Constructor Summary
Constructors Constructor Description NkBuffer(java.nio.ByteBuffer container)
Creates aNkBuffer
instance at the current position of the specifiedByteBuffer
container.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description long
allocated()
Returns the value of theallocated
field.static NkBuffer
calloc()
Returns a newNkBuffer
instance allocated withmemCalloc
.static NkBuffer.Buffer
calloc(int capacity)
Returns a newNkBuffer.Buffer
instance allocated withmemCalloc
.static NkBuffer
callocStack()
Returns a newNkBuffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static NkBuffer.Buffer
callocStack(int capacity)
Returns a newNkBuffer.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static NkBuffer.Buffer
callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newNkBuffer.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static NkBuffer
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newNkBuffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.long
calls()
Returns the value of thecalls
field.static NkBuffer
create()
Returns a newNkBuffer
instance allocated withBufferUtils
.static NkBuffer.Buffer
create(int capacity)
Returns a newNkBuffer.Buffer
instance allocated withBufferUtils
.static NkBuffer
create(long address)
Returns a newNkBuffer
instance for the specified memory address.static NkBuffer.Buffer
create(long address, int capacity)
Create aNkBuffer.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 thegrow_factor
field.static NkBuffer
malloc()
Returns a newNkBuffer
instance allocated withmemAlloc
.static NkBuffer.Buffer
malloc(int capacity)
Returns a newNkBuffer.Buffer
instance allocated withmemAlloc
.static NkBuffer
mallocStack()
Returns a newNkBuffer
instance allocated on the thread-localMemoryStack
.static NkBuffer.Buffer
mallocStack(int capacity)
Returns a newNkBuffer.Buffer
instance allocated on the thread-localMemoryStack
.static NkBuffer.Buffer
mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newNkBuffer.Buffer
instance allocated on the specifiedMemoryStack
.static NkBuffer
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newNkBuffer
instance allocated on the specifiedMemoryStack
.NkBufferMarker.Buffer
marker()
Returns aNkBufferMarker
.Buffer view of themarker
field.NkBufferMarker
marker(int index)
Returns aNkBufferMarker
view of the struct at the specified index of themarker
field.NkMemory
memory()
Returns aNkMemory
view of thememory
field.static long
nallocated(long struct)
Unsafe version ofallocated()
.static long
ncalls(long struct)
Unsafe version ofcalls()
.long
needed()
Returns the value of theneeded
field.static float
ngrow_factor(long struct)
Unsafe version ofgrow_factor()
.static NkBufferMarker.Buffer
nmarker(long struct)
Unsafe version ofmarker()
.static NkBufferMarker
nmarker(long struct, int index)
Unsafe version ofmarker
.static NkMemory
nmemory(long struct)
Unsafe version ofmemory()
.static long
nneeded(long struct)
Unsafe version ofneeded()
.static NkAllocator
npool(long struct)
Unsafe version ofpool()
.static long
nsize(long struct)
Unsafe version ofsize()
.static int
ntype(long struct)
Unsafe version oftype()
.NkAllocator
pool()
Returns aNkAllocator
view of thepool
field.long
size()
Returns the value of thesize
field.int
sizeof()
int
type()
Returns the value of thetype
field.
-
-
-
Constructor Detail
-
NkBuffer
public NkBuffer(java.nio.ByteBuffer container)
Creates aNkBuffer
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
-
marker
public NkBufferMarker.Buffer marker()
Returns aNkBufferMarker
.Buffer view of themarker
field.
-
marker
public NkBufferMarker marker(int index)
Returns aNkBufferMarker
view of the struct at the specified index of themarker
field.
-
pool
public NkAllocator pool()
Returns aNkAllocator
view of thepool
field.
-
type
public int type()
Returns the value of thetype
field.
-
grow_factor
public float grow_factor()
Returns the value of thegrow_factor
field.
-
allocated
public long allocated()
Returns the value of theallocated
field.
-
needed
public long needed()
Returns the value of theneeded
field.
-
calls
public long calls()
Returns the value of thecalls
field.
-
size
public long size()
Returns the value of thesize
field.
-
malloc
public static NkBuffer malloc()
Returns a newNkBuffer
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static NkBuffer calloc()
Returns a newNkBuffer
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static NkBuffer create()
Returns a newNkBuffer
instance allocated withBufferUtils
.
-
create
public static NkBuffer create(long address)
Returns a newNkBuffer
instance for the specified memory address.
-
createSafe
@Nullable public static NkBuffer createSafe(long address)
-
malloc
public static NkBuffer.Buffer malloc(int capacity)
Returns a newNkBuffer.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static NkBuffer.Buffer calloc(int capacity)
Returns a newNkBuffer.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static NkBuffer.Buffer create(int capacity)
Returns a newNkBuffer.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static NkBuffer.Buffer create(long address, int capacity)
Create aNkBuffer.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
createSafe
@Nullable public static NkBuffer.Buffer createSafe(long address, int capacity)
-
mallocStack
public static NkBuffer mallocStack()
Returns a newNkBuffer
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static NkBuffer callocStack()
Returns a newNkBuffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static NkBuffer mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newNkBuffer
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static NkBuffer callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newNkBuffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
mallocStack
public static NkBuffer.Buffer mallocStack(int capacity)
Returns a newNkBuffer.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static NkBuffer.Buffer callocStack(int capacity)
Returns a newNkBuffer.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.- Parameters:
capacity
- the buffer capacity
-
mallocStack
public static NkBuffer.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newNkBuffer.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
callocStack
public static NkBuffer.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newNkBuffer.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
nmarker
public static NkBufferMarker.Buffer nmarker(long struct)
Unsafe version ofmarker()
.
-
nmarker
public static NkBufferMarker nmarker(long struct, int index)
Unsafe version ofmarker
.
-
npool
public static NkAllocator npool(long struct)
Unsafe version ofpool()
.
-
ntype
public static int ntype(long struct)
Unsafe version oftype()
.
-
ngrow_factor
public static float ngrow_factor(long struct)
Unsafe version ofgrow_factor()
.
-
nallocated
public static long nallocated(long struct)
Unsafe version ofallocated()
.
-
nneeded
public static long nneeded(long struct)
Unsafe version ofneeded()
.
-
ncalls
public static long ncalls(long struct)
Unsafe version ofcalls()
.
-
nsize
public static long nsize(long struct)
Unsafe version ofsize()
.
-
-