Class NkFontAtlas

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class NkFontAtlas extends Struct<NkFontAtlas> implements NativeResource

 struct nk_font_atlas {
     void * pixel;
     int tex_width;
     int tex_height;
     {@link NkAllocator struct nk_allocator} permanent;
     {@link NkAllocator struct nk_allocator} temporary;
     {@link NkRecti struct nk_recti} custom;
     {@link NkCursor struct nk_cursor} cursors[7];
     int glyph_count;
     {@link NkFontGlyph struct nk_font_glyph} * glyphs;
     {@link NkFont struct nk_font} * default_font;
     {@link NkFont struct nk_font} * fonts;
     {@link NkFontConfig struct nk_font_config} * config;
     int font_num;
 }
  • Field Details

    • SIZEOF

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

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

      public static final int PIXEL
      The struct member offsets.
    • TEX_WIDTH

      public static final int TEX_WIDTH
      The struct member offsets.
    • TEX_HEIGHT

      public static final int TEX_HEIGHT
      The struct member offsets.
    • PERMANENT

      public static final int PERMANENT
      The struct member offsets.
    • TEMPORARY

      public static final int TEMPORARY
      The struct member offsets.
    • CUSTOM

      public static final int CUSTOM
      The struct member offsets.
    • CURSORS

      public static final int CURSORS
      The struct member offsets.
    • GLYPH_COUNT

      public static final int GLYPH_COUNT
      The struct member offsets.
    • GLYPHS

      public static final int GLYPHS
      The struct member offsets.
    • DEFAULT_FONT

      public static final int DEFAULT_FONT
      The struct member offsets.
    • FONTS

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

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

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

    • NkFontAtlas

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

      public @Nullable ByteBuffer pixel()
      Returns:
      a ByteBuffer view of the data pointed to by the pixel field.
    • tex_width

      public int tex_width()
      Returns:
      the value of the tex_width field.
    • tex_height

      public int tex_height()
      Returns:
      the value of the tex_height field.
    • permanent

      public NkAllocator permanent()
      Returns:
      a NkAllocator view of the permanent field.
    • temporary

      public NkAllocator temporary()
      Returns:
      a NkAllocator view of the temporary field.
    • custom

      public NkRecti custom()
      Returns:
      a NkRecti view of the custom field.
    • cursors

      public NkCursor.Buffer cursors()
      Returns:
      a NkCursor.Buffer view of the cursors field.
    • cursors

      public NkCursor cursors(int index)
      Returns:
      a NkCursor view of the struct at the specified index of the cursors field.
    • glyph_count

      public int glyph_count()
      Returns:
      the value of the glyph_count field.
    • glyphs

      public @Nullable NkFontGlyph.Buffer glyphs()
      Returns:
      a NkFontGlyph.Buffer view of the struct array pointed to by the glyphs field.
    • default_font

      public @Nullable NkFont default_font()
      Returns:
      a NkFont view of the struct pointed to by the default_font field.
    • fonts

      public @Nullable NkFont fonts()
      Returns:
      a NkFont view of the struct pointed to by the fonts field.
    • config

      public @Nullable NkFontConfig config()
      Returns:
      a NkFontConfig view of the struct pointed to by the config field.
    • font_num

      public int font_num()
      Returns:
      the value of the font_num field.
    • pixel

      public NkFontAtlas pixel(@Nullable ByteBuffer value)
      Sets the address of the specified ByteBuffer to the pixel field.
    • tex_width

      public NkFontAtlas tex_width(int value)
      Sets the specified value to the tex_width field.
    • tex_height

      public NkFontAtlas tex_height(int value)
      Sets the specified value to the tex_height field.
    • permanent

      public NkFontAtlas permanent(NkAllocator value)
      Copies the specified NkAllocator to the permanent field.
    • permanent

      public NkFontAtlas permanent(Consumer<NkAllocator> consumer)
      Passes the permanent field to the specified Consumer.
    • temporary

      public NkFontAtlas temporary(NkAllocator value)
      Copies the specified NkAllocator to the temporary field.
    • temporary

      public NkFontAtlas temporary(Consumer<NkAllocator> consumer)
      Passes the temporary field to the specified Consumer.
    • custom

      public NkFontAtlas custom(NkRecti value)
      Copies the specified NkRecti to the custom field.
    • custom

      public NkFontAtlas custom(Consumer<NkRecti> consumer)
      Passes the custom field to the specified Consumer.
    • cursors

      public NkFontAtlas cursors(NkCursor.Buffer value)
      Copies the specified NkCursor.Buffer to the cursors field.
    • cursors

      public NkFontAtlas cursors(int index, NkCursor value)
      Copies the specified NkCursor at the specified index of the cursors field.
    • cursors

      public NkFontAtlas cursors(Consumer<NkCursor.Buffer> consumer)
      Passes the cursors field to the specified Consumer.
    • cursors

      public NkFontAtlas cursors(int index, Consumer<NkCursor> consumer)
      Passes the element at index of the cursors field to the specified Consumer.
    • glyph_count

      public NkFontAtlas glyph_count(int value)
      Sets the specified value to the glyph_count field.
    • glyphs

      public NkFontAtlas glyphs(@Nullable NkFontGlyph.Buffer value)
      Sets the address of the specified NkFontGlyph.Buffer to the glyphs field.
    • default_font

      public NkFontAtlas default_font(@Nullable NkFont value)
      Sets the address of the specified NkFont to the default_font field.
    • fonts

      public NkFontAtlas fonts(@Nullable NkFont value)
      Sets the address of the specified NkFont to the fonts field.
    • config

      public NkFontAtlas config(@Nullable NkFontConfig value)
      Sets the address of the specified NkFontConfig to the config field.
    • font_num

      public NkFontAtlas font_num(int value)
      Sets the specified value to the font_num field.
    • set

      public NkFontAtlas set(@Nullable ByteBuffer pixel, int tex_width, int tex_height, NkAllocator permanent, NkAllocator temporary, NkRecti custom, NkCursor.Buffer cursors, int glyph_count, @Nullable NkFontGlyph.Buffer glyphs, @Nullable NkFont default_font, @Nullable NkFont fonts, @Nullable NkFontConfig config, int font_num)
      Initializes this struct with the specified values.
    • set

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      public static @Nullable ByteBuffer npixel(long struct)
      Unsafe version of pixel.
    • ntex_width

      public static int ntex_width(long struct)
      Unsafe version of tex_width().
    • ntex_height

      public static int ntex_height(long struct)
      Unsafe version of tex_height().
    • npermanent

      public static NkAllocator npermanent(long struct)
      Unsafe version of permanent().
    • ntemporary

      public static NkAllocator ntemporary(long struct)
      Unsafe version of temporary().
    • ncustom

      public static NkRecti ncustom(long struct)
      Unsafe version of custom().
    • ncursors

      public static NkCursor.Buffer ncursors(long struct)
      Unsafe version of cursors().
    • ncursors

      public static NkCursor ncursors(long struct, int index)
      Unsafe version of cursors.
    • nglyph_count

      public static int nglyph_count(long struct)
      Unsafe version of glyph_count().
    • nglyphs

      public static @Nullable NkFontGlyph.Buffer nglyphs(long struct)
      Unsafe version of glyphs().
    • ndefault_font

      public static @Nullable NkFont ndefault_font(long struct)
      Unsafe version of default_font().
    • nfonts

      public static @Nullable NkFont nfonts(long struct)
      Unsafe version of fonts().
    • nconfig

      public static @Nullable NkFontConfig nconfig(long struct)
      Unsafe version of config().
    • nfont_num

      public static int nfont_num(long struct)
      Unsafe version of font_num().
    • npixel

      public static void npixel(long struct, @Nullable ByteBuffer value)
      Unsafe version of pixel.
    • ntex_width

      public static void ntex_width(long struct, int value)
      Sets the specified value to the tex_width field of the specified struct.
    • ntex_height

      public static void ntex_height(long struct, int value)
      Sets the specified value to the tex_height field of the specified struct.
    • npermanent

      public static void npermanent(long struct, NkAllocator value)
      Unsafe version of permanent.
    • ntemporary

      public static void ntemporary(long struct, NkAllocator value)
      Unsafe version of temporary.
    • ncustom

      public static void ncustom(long struct, NkRecti value)
      Unsafe version of custom.
    • ncursors

      public static void ncursors(long struct, NkCursor.Buffer value)
      Unsafe version of cursors.
    • ncursors

      public static void ncursors(long struct, int index, NkCursor value)
      Unsafe version of cursors.
    • nglyph_count

      public static void nglyph_count(long struct, int value)
      Sets the specified value to the glyph_count field of the specified struct.
    • nglyphs

      public static void nglyphs(long struct, @Nullable NkFontGlyph.Buffer value)
      Unsafe version of glyphs.
    • ndefault_font

      public static void ndefault_font(long struct, @Nullable NkFont value)
      Unsafe version of default_font.
    • nfonts

      public static void nfonts(long struct, @Nullable NkFont value)
      Unsafe version of fonts.
    • nconfig

      public static void nconfig(long struct, @Nullable NkFontConfig value)
      Unsafe version of config.
    • nfont_num

      public static void nfont_num(long struct, int value)
      Unsafe version of font_num.