Class NkCursor

  • All Implemented Interfaces:
    java.lang.AutoCloseable, org.lwjgl.system.NativeResource, org.lwjgl.system.Pointer

    public class NkCursor
    extends org.lwjgl.system.Struct
    implements org.lwjgl.system.NativeResource

    Layout

    
     struct nk_cursor {
         struct nk_image img;
         struct nk_vec2 size;
         struct nk_vec2 offset;
     }
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  NkCursor.Buffer
      An array of NkCursor structs.
      • Nested classes/interfaces inherited from interface org.lwjgl.system.Pointer

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

      Fields 
      Modifier and Type Field Description
      static int ALIGNOF
      The struct alignment in bytes.
      static int IMG
      OFFSET
      SIZE
      The struct member offsets.
      static int SIZEOF
      The struct size in bytes.
      • Fields inherited from interface org.lwjgl.system.Pointer

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

      Constructors 
      Constructor Description
      NkCursor​(java.nio.ByteBuffer container)
      Creates a NkCursor instance at the current position of the specified ByteBuffer container.
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • IMG, SIZE, OFFSET

        The struct member offsets.
    • Constructor Detail

      • NkCursor

        public NkCursor​(java.nio.ByteBuffer container)
        Creates a NkCursor 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 Detail

      • sizeof

        public int sizeof()
        Specified by:
        sizeof in class org.lwjgl.system.Struct
      • size

        public NkVec2 size()
        Returns a NkVec2 view of the size field.
      • offset

        public NkVec2 offset()
        Returns a NkVec2 view of the offset field.
      • img

        public NkCursor img​(java.util.function.Consumer<NkImage> consumer)
        Passes the img field to the specified Consumer.
      • size

        public NkCursor size​(java.util.function.Consumer<NkVec2> consumer)
        Passes the size field to the specified Consumer.
      • offset

        public NkCursor offset​(NkVec2 value)
        Copies the specified NkVec2 to the offset field.
      • offset

        public NkCursor offset​(java.util.function.Consumer<NkVec2> consumer)
        Passes the offset field to the specified Consumer.
      • set

        public NkCursor set​(NkCursor src)
        Copies the specified struct data to this struct.
        Parameters:
        src - the source struct
        Returns:
        this struct
      • malloc

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

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

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

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

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

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

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

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

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

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

        public static NkCursor mallocStack()
        Returns a new NkCursor instance allocated on the thread-local MemoryStack.
      • callocStack

        public static NkCursor callocStack()
        Returns a new NkCursor instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
      • mallocStack

        public static NkCursor mallocStack​(org.lwjgl.system.MemoryStack stack)
        Returns a new NkCursor instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
      • callocStack

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

        public static NkCursor.Buffer mallocStack​(int capacity)
        Returns a new NkCursor.Buffer instance allocated on the thread-local MemoryStack.
        Parameters:
        capacity - the buffer capacity
      • callocStack

        public static NkCursor.Buffer callocStack​(int capacity)
        Returns a new NkCursor.Buffer instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
        Parameters:
        capacity - the buffer capacity
      • mallocStack

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

        public static NkCursor.Buffer callocStack​(int capacity,
                                                  org.lwjgl.system.MemoryStack stack)
        Returns a new NkCursor.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
        capacity - the buffer capacity
      • nimg

        public static NkImage nimg​(long struct)
        Unsafe version of img().
      • nsize

        public static NkVec2 nsize​(long struct)
        Unsafe version of size().
      • noffset

        public static NkVec2 noffset​(long struct)
        Unsafe version of offset().
      • nimg

        public static void nimg​(long struct,
                                NkImage value)
        Unsafe version of img.
      • nsize

        public static void nsize​(long struct,
                                 NkVec2 value)
        Unsafe version of size.
      • noffset

        public static void noffset​(long struct,
                                   NkVec2 value)
        Unsafe version of offset.