Class NkBuffer

java.lang.Object
org.lwjgl.system.Pointer.Default
org.lwjgl.system.Struct<NkBuffer>
org.lwjgl.nuklear.NkBuffer
All Implemented Interfaces:
AutoCloseable, org.lwjgl.system.NativeResource, org.lwjgl.system.Pointer

public class NkBuffer extends org.lwjgl.system.Struct<NkBuffer> implements org.lwjgl.system.NativeResource

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 
    An array of NkBuffer structs.

    Nested classes/interfaces inherited from class org.lwjgl.system.Struct

    org.lwjgl.system.Struct.StructValidation

    Nested classes/interfaces inherited from interface org.lwjgl.system.Pointer

    org.lwjgl.system.Pointer.Default
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    The struct alignment in bytes.
    static final int
    The struct member offsets.
    static final int
    The struct member offsets.
    static final int
    The struct member offsets.
    static final int
    The struct member offsets.
    static final int
    The struct member offsets.
    static final int
    The struct member offsets.
    static final int
    The struct member offsets.
    static final int
    The struct member offsets.
    static final int
    The struct size in bytes.
    static final int
    The struct member offsets.

    Fields inherited from interface org.lwjgl.system.Pointer

    BITS32, BITS64, CLONG_SHIFT, CLONG_SIZE, POINTER_SHIFT, POINTER_SIZE
  • Constructor Summary

    Constructors
    Constructor
    Description
    NkBuffer(ByteBuffer container)
    Creates a NkBuffer instance at the current position of the specified ByteBuffer container.
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    total amount of memory allocated
    static NkBuffer
    Returns a new NkBuffer instance allocated with memCalloc.
    calloc(int capacity)
    Returns a new NkBuffer.Buffer instance allocated with memCalloc.
    calloc(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
    calloc(org.lwjgl.system.MemoryStack stack)
    Returns a new NkBuffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
    static NkBuffer
    Deprecated.
    callocStack(int capacity)
    Deprecated.
    callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
    Deprecated.
    static NkBuffer
    callocStack(org.lwjgl.system.MemoryStack stack)
    Deprecated.
    long
    number of allocation calls
    static NkBuffer
    Returns a new NkBuffer instance allocated with BufferUtils.
    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.
    create(long address, int capacity)
    Create a NkBuffer.Buffer instance at the specified memory.
    static @Nullable NkBuffer
    createSafe(long address)
    Like create, but returns null if address is NULL.
    static @Nullable NkBuffer.Buffer
    createSafe(long address, int capacity)
    Like create, but returns null if address is NULL.
    float
    growing factor for dynamic memory management
    static NkBuffer
    Returns a new NkBuffer instance allocated with memAlloc.
    malloc(int capacity)
    Returns a new NkBuffer.Buffer instance allocated with memAlloc.
    malloc(int capacity, org.lwjgl.system.MemoryStack stack)
    Returns a new NkBuffer.Buffer instance allocated on the specified MemoryStack.
    static NkBuffer
    malloc(org.lwjgl.system.MemoryStack stack)
    Returns a new NkBuffer instance allocated on the specified MemoryStack.
    static NkBuffer
    Deprecated.
    mallocStack(int capacity)
    Deprecated.
    mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
    Deprecated.
    static NkBuffer
    mallocStack(org.lwjgl.system.MemoryStack stack)
    Deprecated.
    buffer marker to free a buffer to a certain offset
    marker(int index)
    buffer marker to free a buffer to a certain offset
    memory and size of the current memory block
    static long
    nallocated(long struct)
    Unsafe version of allocated().
    static long
    ncalls(long struct)
    Unsafe version of calls().
    long
    totally consumed memory given that enough memory is present
    static float
    ngrow_factor(long struct)
    Unsafe version of grow_factor().
    nmarker(long struct)
    Unsafe version of marker().
    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().
    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().
    allocator callback for dynamic buffers
    long
    current size of the buffer
    int
     
    int
    memory management type

    Methods inherited from class org.lwjgl.system.Struct

    clear, free, isNull, validate, validate

    Methods inherited from class org.lwjgl.system.Pointer.Default

    address, equals, hashCode, toString

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.lwjgl.system.NativeResource

    close, free
  • Field Details

    • SIZEOF

      public static final int SIZEOF
      The struct size in bytes.
    • ALIGNOF

      public static final int ALIGNOF
      The struct alignment in bytes.
    • MARKER

      public static final int MARKER
      The struct member offsets.
    • POOL

      public static final int POOL
      The struct member offsets.
    • TYPE

      public static final int TYPE
      The struct member offsets.
    • MEMORY

      public static final int MEMORY
      The struct member offsets.
    • GROW_FACTOR

      public static final int GROW_FACTOR
      The struct member offsets.
    • ALLOCATED

      public static final int ALLOCATED
      The struct member offsets.
    • NEEDED

      public static final int NEEDED
      The struct member offsets.
    • CALLS

      public static final int CALLS
      The struct member offsets.
    • SIZE

      public static final int SIZE
      The struct member offsets.
  • Constructor Details

    • NkBuffer

      public NkBuffer(ByteBuffer container)
      Creates a 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.

  • Method Details

    • sizeof

      public int sizeof()
      Specified by:
      sizeof in class org.lwjgl.system.Struct<NkBuffer>
    • marker

      public NkBufferMarker.Buffer marker()
      buffer marker to free a buffer to a certain offset
    • marker

      public NkBufferMarker marker(int index)
      buffer marker to free a buffer to a certain offset
    • pool

      public NkAllocator pool()
      allocator callback for dynamic buffers
    • type

      public int type()
      memory management type
    • memory

      public NkMemory memory()
      memory and size of the current memory block
    • grow_factor

      public float grow_factor()
      growing factor for dynamic memory management
    • allocated

      public long allocated()
      total amount of memory allocated
    • needed

      public long needed()
      totally consumed memory given that enough memory is present
    • calls

      public long calls()
      number of allocation calls
    • size

      public long size()
      current size of the buffer
    • malloc

      public static NkBuffer malloc()
      Returns a new NkBuffer instance allocated with memAlloc. The instance must be explicitly freed.
    • calloc

      public static NkBuffer calloc()
      Returns a new NkBuffer instance allocated with memCalloc. The instance must be explicitly freed.
    • create

      public static NkBuffer create()
      Returns a new NkBuffer instance allocated with BufferUtils.
    • create

      public static NkBuffer create(long address)
      Returns a new NkBuffer instance for the specified memory address.
    • createSafe

      public static @Nullable NkBuffer createSafe(long address)
      Like create, but returns null if address is NULL.
    • malloc

      public static NkBuffer.Buffer malloc(int capacity)
      Returns a new NkBuffer.Buffer instance allocated with memAlloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • calloc

      public static NkBuffer.Buffer calloc(int capacity)
      Returns a new NkBuffer.Buffer instance allocated with memCalloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • create

      public static NkBuffer.Buffer create(int capacity)
      Returns a new NkBuffer.Buffer instance allocated with BufferUtils.
      Parameters:
      capacity - the buffer capacity
    • create

      public static NkBuffer.Buffer create(long address, int capacity)
      Create a NkBuffer.Buffer instance at the specified memory.
      Parameters:
      address - the memory address
      capacity - the buffer capacity
    • createSafe

      public static @Nullable NkBuffer.Buffer createSafe(long address, int capacity)
      Like create, but returns null if address is NULL.
    • mallocStack

      @Deprecated public static NkBuffer mallocStack()
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.
    • callocStack

      @Deprecated public static NkBuffer callocStack()
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.
    • mallocStack

      @Deprecated public static NkBuffer mallocStack(org.lwjgl.system.MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.
    • callocStack

      @Deprecated public static NkBuffer callocStack(org.lwjgl.system.MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.
    • mallocStack

      @Deprecated public static NkBuffer.Buffer mallocStack(int capacity)
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(int, MemoryStack) instead.
    • callocStack

      @Deprecated public static NkBuffer.Buffer callocStack(int capacity)
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(int, MemoryStack) instead.
    • mallocStack

      @Deprecated public static NkBuffer.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(int, MemoryStack) instead.
    • callocStack

      @Deprecated public static NkBuffer.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(int, MemoryStack) instead.
    • malloc

      public static NkBuffer malloc(org.lwjgl.system.MemoryStack stack)
      Returns a new NkBuffer instance allocated on the specified MemoryStack.
      Parameters:
      stack - the stack from which to allocate
    • calloc

      public static NkBuffer calloc(org.lwjgl.system.MemoryStack stack)
      Returns a new NkBuffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      stack - the stack from which to allocate
    • malloc

      public static NkBuffer.Buffer malloc(int capacity, org.lwjgl.system.MemoryStack stack)
      Returns a new NkBuffer.Buffer instance allocated on the specified MemoryStack.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • calloc

      public static NkBuffer.Buffer calloc(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.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • nmarker

      public static NkBufferMarker.Buffer nmarker(long struct)
      Unsafe version of marker().
    • nmarker

      public static NkBufferMarker nmarker(long struct, int index)
      Unsafe version of marker.
    • npool

      public static NkAllocator npool(long struct)
      Unsafe version of pool().
    • ntype

      public static int ntype(long struct)
      Unsafe version of type().
    • nmemory

      public static NkMemory nmemory(long struct)
      Unsafe version of memory().
    • ngrow_factor

      public static float ngrow_factor(long struct)
      Unsafe version of grow_factor().
    • nallocated

      public static long nallocated(long struct)
      Unsafe version of allocated().
    • nneeded

      public static long nneeded(long struct)
      Unsafe version of needed().
    • ncalls

      public static long ncalls(long struct)
      Unsafe version of calls().
    • nsize

      public static long nsize(long struct)
      Unsafe version of size().