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.NativeResourceMember documentation
marker– 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_markermarker[2];struct nk_allocatorpool; enum nk_allocation_type type;struct nk_memorymemory; 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 classNkBuffer.BufferAn array ofNkBufferstructs.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description longallocated()Returns the value of theallocatedfield.static NkBuffercalloc()Returns a newNkBufferinstance allocated withmemCalloc.static NkBuffer.Buffercalloc(int capacity)Returns a newNkBuffer.Bufferinstance allocated withmemCalloc.static NkBuffercallocStack()Returns a newNkBufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static NkBuffer.BuffercallocStack(int capacity)Returns a newNkBuffer.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static NkBuffer.BuffercallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newNkBuffer.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static NkBuffercallocStack(org.lwjgl.system.MemoryStack stack)Returns a newNkBufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.longcalls()Returns the value of thecallsfield.static NkBuffercreate()Returns a newNkBufferinstance allocated withBufferUtils.static NkBuffer.Buffercreate(int capacity)Returns a newNkBuffer.Bufferinstance allocated withBufferUtils.static NkBuffercreate(long address)Returns a newNkBufferinstance for the specified memory address.static NkBuffer.Buffercreate(long address, int capacity)Create aNkBuffer.Bufferinstance at the specified memory.static NkBuffercreateSafe(long address)static NkBuffer.BuffercreateSafe(long address, int capacity)floatgrow_factor()Returns the value of thegrow_factorfield.static NkBuffermalloc()Returns a newNkBufferinstance allocated withmemAlloc.static NkBuffer.Buffermalloc(int capacity)Returns a newNkBuffer.Bufferinstance allocated withmemAlloc.static NkBuffermallocStack()Returns a newNkBufferinstance allocated on the thread-localMemoryStack.static NkBuffer.BuffermallocStack(int capacity)Returns a newNkBuffer.Bufferinstance allocated on the thread-localMemoryStack.static NkBuffer.BuffermallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newNkBuffer.Bufferinstance allocated on the specifiedMemoryStack.static NkBuffermallocStack(org.lwjgl.system.MemoryStack stack)Returns a newNkBufferinstance allocated on the specifiedMemoryStack.NkBufferMarker.Buffermarker()Returns aNkBufferMarker.Buffer view of themarkerfield.NkBufferMarkermarker(int index)Returns aNkBufferMarkerview of the struct at the specified index of themarkerfield.NkMemorymemory()Returns aNkMemoryview of thememoryfield.static longnallocated(long struct)Unsafe version ofallocated().static longncalls(long struct)Unsafe version ofcalls().longneeded()Returns the value of theneededfield.static floatngrow_factor(long struct)Unsafe version ofgrow_factor().static NkBufferMarker.Buffernmarker(long struct)Unsafe version ofmarker().static NkBufferMarkernmarker(long struct, int index)Unsafe version ofmarker.static NkMemorynmemory(long struct)Unsafe version ofmemory().static longnneeded(long struct)Unsafe version ofneeded().static NkAllocatornpool(long struct)Unsafe version ofpool().static longnsize(long struct)Unsafe version ofsize().static intntype(long struct)Unsafe version oftype().NkAllocatorpool()Returns aNkAllocatorview of thepoolfield.NkBufferpool(java.util.function.Consumer<NkAllocator> consumer)Passes thepoolfield to the specifiedConsumer.longsize()Returns the value of thesizefield.intsizeof()inttype()Returns the value of thetypefield.
-
-
-
Constructor Detail
-
NkBuffer
public NkBuffer(java.nio.ByteBuffer container)
Creates aNkBufferinstance 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
-
marker
public NkBufferMarker.Buffer marker()
Returns aNkBufferMarker.Buffer view of themarkerfield.
-
marker
public NkBufferMarker marker(int index)
Returns aNkBufferMarkerview of the struct at the specified index of themarkerfield.
-
pool
public NkAllocator pool()
Returns aNkAllocatorview of thepoolfield.
-
pool
public NkBuffer pool(java.util.function.Consumer<NkAllocator> consumer)
Passes thepoolfield to the specifiedConsumer.
-
type
public int type()
Returns the value of thetypefield.
-
grow_factor
public float grow_factor()
Returns the value of thegrow_factorfield.
-
allocated
public long allocated()
Returns the value of theallocatedfield.
-
needed
public long needed()
Returns the value of theneededfield.
-
calls
public long calls()
Returns the value of thecallsfield.
-
size
public long size()
Returns the value of thesizefield.
-
malloc
public static NkBuffer malloc()
Returns a newNkBufferinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static NkBuffer calloc()
Returns a newNkBufferinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static NkBuffer create(long address)
Returns a newNkBufferinstance for the specified memory address.
-
createSafe
@Nullable public static NkBuffer createSafe(long address)
-
malloc
public static NkBuffer.Buffer malloc(int capacity)
Returns a newNkBuffer.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static NkBuffer.Buffer calloc(int capacity)
Returns a newNkBuffer.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static NkBuffer.Buffer create(int capacity)
Returns a newNkBuffer.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static NkBuffer.Buffer create(long address, int capacity)
Create aNkBuffer.Bufferinstance 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 newNkBufferinstance allocated on the thread-localMemoryStack.
-
callocStack
public static NkBuffer callocStack()
Returns a newNkBufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.
-
mallocStack
public static NkBuffer mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newNkBufferinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
callocStack
public static NkBuffer callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newNkBufferinstance allocated on the specifiedMemoryStackand 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.Bufferinstance allocated on the thread-localMemoryStack.- Parameters:
capacity- the buffer capacity
-
callocStack
public static NkBuffer.Buffer callocStack(int capacity)
Returns a newNkBuffer.Bufferinstance allocated on the thread-localMemoryStackand 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.Bufferinstance 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.Bufferinstance allocated on the specifiedMemoryStackand 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().
-
-