Class NkDrawList

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class NkDrawList extends Struct<NkDrawList> implements NativeResource

 struct nk_draw_list {
     {@link NkRect struct nk_rect} clip_rect;
     {@link NkVec2 struct nk_vec2} circle_vtx[12];
     {@link NkConvertConfig struct nk_convert_config} config;
     {@link NkBuffer struct nk_buffer} * buffer;
     {@link NkBuffer struct nk_buffer} * vertices;
     {@link NkBuffer struct nk_buffer} * elements;
     unsigned int element_count;
     unsigned int vertex_count;
     unsigned int cmd_count;
     nk_size cmd_offset;
     unsigned int path_count;
     unsigned int path_offset;
     enum nk_anti_aliasing line_AA;
     enum nk_anti_aliasing shape_AA;
     {@link NkHandle nk_handle} userdata;
 }
  • Field Details

    • SIZEOF

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

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

      public static final int CLIP_RECT
      The struct member offsets.
    • CIRCLE_VTX

      public static final int CIRCLE_VTX
      The struct member offsets.
    • CONFIG

      public static final int CONFIG
      The struct member offsets.
    • BUFFER

      public static final int BUFFER
      The struct member offsets.
    • VERTICES

      public static final int VERTICES
      The struct member offsets.
    • ELEMENTS

      public static final int ELEMENTS
      The struct member offsets.
    • ELEMENT_COUNT

      public static final int ELEMENT_COUNT
      The struct member offsets.
    • VERTEX_COUNT

      public static final int VERTEX_COUNT
      The struct member offsets.
    • CMD_COUNT

      public static final int CMD_COUNT
      The struct member offsets.
    • CMD_OFFSET

      public static final int CMD_OFFSET
      The struct member offsets.
    • PATH_COUNT

      public static final int PATH_COUNT
      The struct member offsets.
    • PATH_OFFSET

      public static final int PATH_OFFSET
      The struct member offsets.
    • LINE_AA

      public static final int LINE_AA
      The struct member offsets.
    • SHAPE_AA

      public static final int SHAPE_AA
      The struct member offsets.
    • USERDATA

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

    • NkDrawList

      public NkDrawList(ByteBuffer container)
      Creates a NkDrawList 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()
      Description copied from class: Struct
      Returns sizeof(struct).
      Specified by:
      sizeof in class Struct<NkDrawList>
    • clip_rect

      public NkRect clip_rect()
      Returns:
      a NkRect view of the clip_rect field.
    • circle_vtx

      public NkVec2.Buffer circle_vtx()
      Returns:
      a NkVec2.Buffer view of the circle_vtx field.
    • circle_vtx

      public NkVec2 circle_vtx(int index)
      Returns:
      a NkVec2 view of the struct at the specified index of the circle_vtx field.
    • config

      public NkConvertConfig config()
      Returns:
      a NkConvertConfig view of the config field.
    • buffer

      public @Nullable NkBuffer buffer()
      Returns:
      a NkBuffer view of the struct pointed to by the buffer field.
    • vertices

      public @Nullable NkBuffer vertices()
      Returns:
      a NkBuffer view of the struct pointed to by the vertices field.
    • elements

      public @Nullable NkBuffer elements()
      Returns:
      a NkBuffer view of the struct pointed to by the elements field.
    • element_count

      public int element_count()
      Returns:
      the value of the element_count field.
    • vertex_count

      public int vertex_count()
      Returns:
      the value of the vertex_count field.
    • cmd_count

      public int cmd_count()
      Returns:
      the value of the cmd_count field.
    • cmd_offset

      public long cmd_offset()
      Returns:
      the value of the cmd_offset field.
    • path_count

      public int path_count()
      Returns:
      the value of the path_count field.
    • path_offset

      public int path_offset()
      Returns:
      the value of the path_offset field.
    • line_AA

      public int line_AA()
      Returns:
      the value of the line_AA field.
    • shape_AA

      public int shape_AA()
      Returns:
      the value of the shape_AA field.
    • userdata

      public NkHandle userdata()
      Returns:
      a NkHandle view of the userdata field.
    • malloc

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      public static NkDrawList.Buffer calloc(int capacity, MemoryStack stack)
      Returns a new NkDrawList.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
    • nclip_rect

      public static NkRect nclip_rect(long struct)
      Unsafe version of clip_rect().
    • ncircle_vtx

      public static NkVec2.Buffer ncircle_vtx(long struct)
      Unsafe version of circle_vtx().
    • ncircle_vtx

      public static NkVec2 ncircle_vtx(long struct, int index)
      Unsafe version of circle_vtx.
    • nconfig

      public static NkConvertConfig nconfig(long struct)
      Unsafe version of config().
    • nbuffer

      public static @Nullable NkBuffer nbuffer(long struct)
      Unsafe version of buffer().
    • nvertices

      public static @Nullable NkBuffer nvertices(long struct)
      Unsafe version of vertices().
    • nelements

      public static @Nullable NkBuffer nelements(long struct)
      Unsafe version of elements().
    • nelement_count

      public static int nelement_count(long struct)
      Unsafe version of element_count().
    • nvertex_count

      public static int nvertex_count(long struct)
      Unsafe version of vertex_count().
    • ncmd_count

      public static int ncmd_count(long struct)
      Unsafe version of cmd_count().
    • ncmd_offset

      public static long ncmd_offset(long struct)
      Unsafe version of cmd_offset().
    • npath_count

      public static int npath_count(long struct)
      Unsafe version of path_count().
    • npath_offset

      public static int npath_offset(long struct)
      Unsafe version of path_offset().
    • nline_AA

      public static int nline_AA(long struct)
      Unsafe version of line_AA().
    • nshape_AA

      public static int nshape_AA(long struct)
      Unsafe version of shape_AA().
    • nuserdata

      public static NkHandle nuserdata(long struct)
      Unsafe version of userdata().