Package org.lwjgl.nuklear
Class NkUserFontGlyph
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.nuklear.NkUserFontGlyph
-
- All Implemented Interfaces:
java.lang.AutoCloseable,org.lwjgl.system.NativeResource,org.lwjgl.system.Pointer
public class NkUserFontGlyph extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResourceMember documentation
uv– texture coordinatesoffset– offset between top left and glyphwidth– width of the glyphheight– height of the glyphxadvance– offset to the next glyph
Layout
struct nk_user_font_glyph {struct nk_vec2uv[2];struct nk_vec2offset; float width; float height; float xadvance; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classNkUserFontGlyph.BufferAn array ofNkUserFontGlyphstructs.
-
Constructor Summary
Constructors Constructor Description NkUserFontGlyph(java.nio.ByteBuffer container)Creates aNkUserFontGlyphinstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static NkUserFontGlyphcalloc()Returns a newNkUserFontGlyphinstance allocated withmemCalloc.static NkUserFontGlyph.Buffercalloc(int capacity)Returns a newNkUserFontGlyph.Bufferinstance allocated withmemCalloc.static NkUserFontGlyphcallocStack()Returns a newNkUserFontGlyphinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static NkUserFontGlyph.BuffercallocStack(int capacity)Returns a newNkUserFontGlyph.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static NkUserFontGlyph.BuffercallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newNkUserFontGlyph.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static NkUserFontGlyphcallocStack(org.lwjgl.system.MemoryStack stack)Returns a newNkUserFontGlyphinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static NkUserFontGlyphcreate()Returns a newNkUserFontGlyphinstance allocated withBufferUtils.static NkUserFontGlyph.Buffercreate(int capacity)Returns a newNkUserFontGlyph.Bufferinstance allocated withBufferUtils.static NkUserFontGlyphcreate(long address)Returns a newNkUserFontGlyphinstance for the specified memory address.static NkUserFontGlyph.Buffercreate(long address, int capacity)Create aNkUserFontGlyph.Bufferinstance at the specified memory.static NkUserFontGlyphcreateSafe(long address)static NkUserFontGlyph.BuffercreateSafe(long address, int capacity)floatheight()Returns the value of theheightfield.NkUserFontGlyphheight(float value)Sets the specified value to theheightfield.static NkUserFontGlyphmalloc()Returns a newNkUserFontGlyphinstance allocated withmemAlloc.static NkUserFontGlyph.Buffermalloc(int capacity)Returns a newNkUserFontGlyph.Bufferinstance allocated withmemAlloc.static NkUserFontGlyphmallocStack()Returns a newNkUserFontGlyphinstance allocated on the thread-localMemoryStack.static NkUserFontGlyph.BuffermallocStack(int capacity)Returns a newNkUserFontGlyph.Bufferinstance allocated on the thread-localMemoryStack.static NkUserFontGlyph.BuffermallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newNkUserFontGlyph.Bufferinstance allocated on the specifiedMemoryStack.static NkUserFontGlyphmallocStack(org.lwjgl.system.MemoryStack stack)Returns a newNkUserFontGlyphinstance allocated on the specifiedMemoryStack.static floatnheight(long struct)Unsafe version ofheight().static voidnheight(long struct, float value)Unsafe version ofheight.static NkVec2noffset(long struct)Unsafe version ofoffset().static voidnoffset(long struct, NkVec2 value)Unsafe version ofoffset.static NkVec2.Buffernuv(long struct)Unsafe version ofuv().static NkVec2nuv(long struct, int index)Unsafe version ofuv.static voidnuv(long struct, int index, NkVec2 value)Unsafe version ofuv.static voidnuv(long struct, NkVec2.Buffer value)Unsafe version ofuv.static floatnwidth(long struct)Unsafe version ofwidth().static voidnwidth(long struct, float value)Unsafe version ofwidth.static floatnxadvance(long struct)Unsafe version ofxadvance().static voidnxadvance(long struct, float value)Unsafe version ofxadvance.NkVec2offset()Returns aNkVec2view of theoffsetfield.NkUserFontGlyphoffset(java.util.function.Consumer<NkVec2> consumer)Passes theoffsetfield to the specifiedConsumer.NkUserFontGlyphoffset(NkVec2 value)Copies the specifiedNkVec2to theoffsetfield.NkUserFontGlyphset(NkUserFontGlyph src)Copies the specified struct data to this struct.NkUserFontGlyphset(NkVec2.Buffer uv, NkVec2 offset, float width, float height, float xadvance)Initializes this struct with the specified values.intsizeof()NkVec2.Bufferuv()Returns aNkVec2.Buffer view of theuvfield.NkVec2uv(int index)Returns aNkVec2view of the struct at the specified index of theuvfield.NkUserFontGlyphuv(int index, NkVec2 value)Copies the specifiedNkVec2at the specified index of theuvfield.NkUserFontGlyphuv(NkVec2.Buffer value)Copies the specifiedNkVec2.Bufferto theuvfield.floatwidth()Returns the value of thewidthfield.NkUserFontGlyphwidth(float value)Sets the specified value to thewidthfield.floatxadvance()Returns the value of thexadvancefield.NkUserFontGlyphxadvance(float value)Sets the specified value to thexadvancefield.
-
-
-
Constructor Detail
-
NkUserFontGlyph
public NkUserFontGlyph(java.nio.ByteBuffer container)
Creates aNkUserFontGlyphinstance at the current position of the specifiedByteBuffercontainer. 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:
sizeofin classorg.lwjgl.system.Struct
-
uv
public NkVec2.Buffer uv()
Returns aNkVec2.Buffer view of theuvfield.
-
uv
public NkVec2 uv(int index)
Returns aNkVec2view of the struct at the specified index of theuvfield.
-
offset
public NkUserFontGlyph offset(java.util.function.Consumer<NkVec2> consumer)
Passes theoffsetfield to the specifiedConsumer.
-
width
public float width()
Returns the value of thewidthfield.
-
height
public float height()
Returns the value of theheightfield.
-
xadvance
public float xadvance()
Returns the value of thexadvancefield.
-
uv
public NkUserFontGlyph uv(NkVec2.Buffer value)
Copies the specifiedNkVec2.Bufferto theuvfield.
-
uv
public NkUserFontGlyph uv(int index, NkVec2 value)
Copies the specifiedNkVec2at the specified index of theuvfield.
-
offset
public NkUserFontGlyph offset(NkVec2 value)
Copies the specifiedNkVec2to theoffsetfield.
-
width
public NkUserFontGlyph width(float value)
Sets the specified value to thewidthfield.
-
height
public NkUserFontGlyph height(float value)
Sets the specified value to theheightfield.
-
xadvance
public NkUserFontGlyph xadvance(float value)
Sets the specified value to thexadvancefield.
-
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 newNkUserFontGlyphinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static NkUserFontGlyph calloc()
Returns a newNkUserFontGlyphinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static NkUserFontGlyph create()
Returns a newNkUserFontGlyphinstance allocated withBufferUtils.
-
create
public static NkUserFontGlyph create(long address)
Returns a newNkUserFontGlyphinstance for the specified memory address.
-
createSafe
@Nullable public static NkUserFontGlyph createSafe(long address)
-
malloc
public static NkUserFontGlyph.Buffer malloc(int capacity)
Returns a newNkUserFontGlyph.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static NkUserFontGlyph.Buffer calloc(int capacity)
Returns a newNkUserFontGlyph.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static NkUserFontGlyph.Buffer create(int capacity)
Returns a newNkUserFontGlyph.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static NkUserFontGlyph.Buffer create(long address, int capacity)
Create aNkUserFontGlyph.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
@Nullable public static NkUserFontGlyph.Buffer createSafe(long address, int capacity)
-
mallocStack
public static NkUserFontGlyph mallocStack()
Returns a newNkUserFontGlyphinstance allocated on the thread-localMemoryStack.
-
callocStack
public static NkUserFontGlyph callocStack()
Returns a newNkUserFontGlyphinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.
-
mallocStack
public static NkUserFontGlyph mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newNkUserFontGlyphinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
callocStack
public static NkUserFontGlyph callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newNkUserFontGlyphinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
mallocStack
public static NkUserFontGlyph.Buffer mallocStack(int capacity)
Returns a newNkUserFontGlyph.Bufferinstance allocated on the thread-localMemoryStack.- Parameters:
capacity- the buffer capacity
-
callocStack
public static NkUserFontGlyph.Buffer callocStack(int capacity)
Returns a newNkUserFontGlyph.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.- Parameters:
capacity- the buffer capacity
-
mallocStack
public static NkUserFontGlyph.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newNkUserFontGlyph.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
callocStack
public static NkUserFontGlyph.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newNkUserFontGlyph.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
nuv
public static NkVec2.Buffer nuv(long struct)
Unsafe version ofuv().
-
nwidth
public static float nwidth(long struct)
Unsafe version ofwidth().
-
nheight
public static float nheight(long struct)
Unsafe version ofheight().
-
nxadvance
public static float nxadvance(long struct)
Unsafe version ofxadvance().
-
nuv
public static void nuv(long struct, NkVec2.Buffer value)Unsafe version ofuv.
-
nwidth
public static void nwidth(long struct, float value)Unsafe version ofwidth.
-
nheight
public static void nheight(long struct, float value)Unsafe version ofheight.
-
nxadvance
public static void nxadvance(long struct, float value)Unsafe version ofxadvance.
-
-