Class NkUserFontGlyph

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class NkUserFontGlyph extends Struct<NkUserFontGlyph> implements NativeResource

 struct nk_user_font_glyph {
     struct nk_vec2 uv[2];
     struct nk_vec2 offset;
     float width;
     float height;
     float xadvance;
 }
  • Field Details

    • SIZEOF

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

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

      public static final int UV
      The struct member offsets.
    • OFFSET

      public static final int OFFSET
      The struct member offsets.
    • WIDTH

      public static final int WIDTH
      The struct member offsets.
    • HEIGHT

      public static final int HEIGHT
      The struct member offsets.
    • XADVANCE

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

    • NkUserFontGlyph

      public NkUserFontGlyph(ByteBuffer container)
      Creates a NkUserFontGlyph 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<NkUserFontGlyph>
    • uv

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

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

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

      public float width()
      Returns:
      the value of the width field.
    • height

      public float height()
      Returns:
      the value of the height field.
    • xadvance

      public float xadvance()
      Returns:
      the value of the xadvance field.
    • uv

      public NkUserFontGlyph uv(NkVec2.Buffer value)
      Copies the specified NkVec2.Buffer to the uv field.
    • uv

      public NkUserFontGlyph uv(int index, NkVec2 value)
      Copies the specified NkVec2 at the specified index of the uv field.
    • uv

      public NkUserFontGlyph uv(Consumer<NkVec2.Buffer> consumer)
      Passes the uv field to the specified Consumer.
    • uv

      public NkUserFontGlyph uv(int index, Consumer<NkVec2> consumer)
      Passes the element at index of the uv field to the specified Consumer.
    • offset

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

      public NkUserFontGlyph offset(Consumer<NkVec2> consumer)
      Passes the offset field to the specified Consumer.
    • width

      public NkUserFontGlyph width(float value)
      Sets the specified value to the width field.
    • height

      public NkUserFontGlyph height(float value)
      Sets the specified value to the height field.
    • xadvance

      public NkUserFontGlyph xadvance(float value)
      Sets the specified value to the xadvance field.
    • set

      public NkUserFontGlyph set(NkVec2.Buffer uv, NkVec2 offset, float width, float height, float xadvance)
      Initializes this struct with the specified values.
    • set

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      public static NkVec2.Buffer nuv(long struct)
      Unsafe version of uv().
    • nuv

      public static NkVec2 nuv(long struct, int index)
      Unsafe version of uv.
    • noffset

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

      public static float nwidth(long struct)
      Unsafe version of width().
    • nheight

      public static float nheight(long struct)
      Unsafe version of height().
    • nxadvance

      public static float nxadvance(long struct)
      Unsafe version of xadvance().
    • nuv

      public static void nuv(long struct, NkVec2.Buffer value)
      Unsafe version of uv.
    • nuv

      public static void nuv(long struct, int index, NkVec2 value)
      Unsafe version of uv.
    • noffset

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

      public static void nwidth(long struct, float value)
      Unsafe version of width.
    • nheight

      public static void nheight(long struct, float value)
      Unsafe version of height.
    • nxadvance

      public static void nxadvance(long struct, float value)
      Unsafe version of xadvance.