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.NativeResource
Member documentation
uv[2]
– 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_vec2
uv[2];struct nk_vec2
offset; float width; float height; float xadvance; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
NkUserFontGlyph.Buffer
An array ofNkUserFontGlyph
structs.
-
Constructor Summary
Constructors Constructor Description NkUserFontGlyph(java.nio.ByteBuffer container)
Creates aNkUserFontGlyph
instance at the current position of the specifiedByteBuffer
container.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static NkUserFontGlyph
calloc()
Returns a newNkUserFontGlyph
instance allocated withmemCalloc
.static NkUserFontGlyph.Buffer
calloc(int capacity)
Returns a newNkUserFontGlyph.Buffer
instance allocated withmemCalloc
.static NkUserFontGlyph
callocStack()
Returns a newNkUserFontGlyph
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static NkUserFontGlyph.Buffer
callocStack(int capacity)
Returns a newNkUserFontGlyph.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static NkUserFontGlyph.Buffer
callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newNkUserFontGlyph.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static NkUserFontGlyph
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newNkUserFontGlyph
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static NkUserFontGlyph
create()
Returns a newNkUserFontGlyph
instance allocated withBufferUtils
.static NkUserFontGlyph.Buffer
create(int capacity)
Returns a newNkUserFontGlyph.Buffer
instance allocated withBufferUtils
.static NkUserFontGlyph
create(long address)
Returns a newNkUserFontGlyph
instance for the specified memory address.static NkUserFontGlyph.Buffer
create(long address, int capacity)
Create aNkUserFontGlyph.Buffer
instance at the specified memory.static NkUserFontGlyph
createSafe(long address)
static NkUserFontGlyph.Buffer
createSafe(long address, int capacity)
float
height()
Returns the value of theheight
field.NkUserFontGlyph
height(float value)
Sets the specified value to theheight
field.static NkUserFontGlyph
malloc()
Returns a newNkUserFontGlyph
instance allocated withmemAlloc
.static NkUserFontGlyph.Buffer
malloc(int capacity)
Returns a newNkUserFontGlyph.Buffer
instance allocated withmemAlloc
.static NkUserFontGlyph
mallocStack()
Returns a newNkUserFontGlyph
instance allocated on the thread-localMemoryStack
.static NkUserFontGlyph.Buffer
mallocStack(int capacity)
Returns a newNkUserFontGlyph.Buffer
instance allocated on the thread-localMemoryStack
.static NkUserFontGlyph.Buffer
mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newNkUserFontGlyph.Buffer
instance allocated on the specifiedMemoryStack
.static NkUserFontGlyph
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newNkUserFontGlyph
instance allocated on the specifiedMemoryStack
.static float
nheight(long struct)
Unsafe version ofheight()
.static void
nheight(long struct, float value)
Unsafe version ofheight
.static NkVec2
noffset(long struct)
Unsafe version ofoffset()
.static void
noffset(long struct, NkVec2 value)
Unsafe version ofoffset
.static NkVec2.Buffer
nuv(long struct)
Unsafe version ofuv()
.static NkVec2
nuv(long struct, int index)
Unsafe version ofuv
.static void
nuv(long struct, int index, NkVec2 value)
Unsafe version ofuv
.static void
nuv(long struct, NkVec2.Buffer value)
Unsafe version ofuv
.static float
nwidth(long struct)
Unsafe version ofwidth()
.static void
nwidth(long struct, float value)
Unsafe version ofwidth
.static float
nxadvance(long struct)
Unsafe version ofxadvance()
.static void
nxadvance(long struct, float value)
Unsafe version ofxadvance
.NkVec2
offset()
Returns aNkVec2
view of theoffset
field.NkUserFontGlyph
offset(java.util.function.Consumer<NkVec2> consumer)
Passes theoffset
field to the specifiedConsumer
.NkUserFontGlyph
offset(NkVec2 value)
Copies the specifiedNkVec2
to theoffset
field.NkUserFontGlyph
set(NkUserFontGlyph src)
Copies the specified struct data to this struct.NkUserFontGlyph
set(NkVec2.Buffer uv, NkVec2 offset, float width, float height, float xadvance)
Initializes this struct with the specified values.int
sizeof()
NkVec2.Buffer
uv()
Returns aNkVec2
.Buffer view of theuv
field.NkVec2
uv(int index)
Returns aNkVec2
view of the struct at the specified index of theuv
field.NkUserFontGlyph
uv(int index, java.util.function.Consumer<NkVec2> consumer)
Passes the element atindex
of theuv
field to the specifiedConsumer
.NkUserFontGlyph
uv(int index, NkVec2 value)
Copies the specifiedNkVec2
at the specified index of theuv
field.NkUserFontGlyph
uv(java.util.function.Consumer<NkVec2.Buffer> consumer)
Passes theuv
field to the specifiedConsumer
.NkUserFontGlyph
uv(NkVec2.Buffer value)
Copies the specifiedNkVec2.Buffer
to theuv
field.float
width()
Returns the value of thewidth
field.NkUserFontGlyph
width(float value)
Sets the specified value to thewidth
field.float
xadvance()
Returns the value of thexadvance
field.NkUserFontGlyph
xadvance(float value)
Sets the specified value to thexadvance
field.
-
-
-
Constructor Detail
-
NkUserFontGlyph
public NkUserFontGlyph(java.nio.ByteBuffer container)
Creates aNkUserFontGlyph
instance at the current position of the specifiedByteBuffer
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 classorg.lwjgl.system.Struct
-
uv
public NkVec2.Buffer uv()
Returns aNkVec2
.Buffer view of theuv
field.
-
uv
public NkVec2 uv(int index)
Returns aNkVec2
view of the struct at the specified index of theuv
field.
-
width
public float width()
Returns the value of thewidth
field.
-
height
public float height()
Returns the value of theheight
field.
-
xadvance
public float xadvance()
Returns the value of thexadvance
field.
-
uv
public NkUserFontGlyph uv(NkVec2.Buffer value)
Copies the specifiedNkVec2.Buffer
to theuv
field.
-
uv
public NkUserFontGlyph uv(int index, NkVec2 value)
Copies the specifiedNkVec2
at the specified index of theuv
field.
-
uv
public NkUserFontGlyph uv(java.util.function.Consumer<NkVec2.Buffer> consumer)
Passes theuv
field to the specifiedConsumer
.
-
uv
public NkUserFontGlyph uv(int index, java.util.function.Consumer<NkVec2> consumer)
Passes the element atindex
of theuv
field to the specifiedConsumer
.
-
offset
public NkUserFontGlyph offset(NkVec2 value)
Copies the specifiedNkVec2
to theoffset
field.
-
offset
public NkUserFontGlyph offset(java.util.function.Consumer<NkVec2> consumer)
Passes theoffset
field to the specifiedConsumer
.
-
width
public NkUserFontGlyph width(float value)
Sets the specified value to thewidth
field.
-
height
public NkUserFontGlyph height(float value)
Sets the specified value to theheight
field.
-
xadvance
public NkUserFontGlyph xadvance(float value)
Sets the specified value to thexadvance
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 newNkUserFontGlyph
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static NkUserFontGlyph calloc()
Returns a newNkUserFontGlyph
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static NkUserFontGlyph create()
Returns a newNkUserFontGlyph
instance allocated withBufferUtils
.
-
create
public static NkUserFontGlyph create(long address)
Returns a newNkUserFontGlyph
instance for the specified memory address.
-
createSafe
@Nullable public static NkUserFontGlyph createSafe(long address)
-
malloc
public static NkUserFontGlyph.Buffer malloc(int capacity)
Returns a newNkUserFontGlyph.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static NkUserFontGlyph.Buffer calloc(int capacity)
Returns a newNkUserFontGlyph.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static NkUserFontGlyph.Buffer create(int capacity)
Returns a newNkUserFontGlyph.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static NkUserFontGlyph.Buffer create(long address, int capacity)
Create aNkUserFontGlyph.Buffer
instance 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 newNkUserFontGlyph
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static NkUserFontGlyph callocStack()
Returns a newNkUserFontGlyph
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static NkUserFontGlyph mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newNkUserFontGlyph
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static NkUserFontGlyph callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newNkUserFontGlyph
instance allocated on the specifiedMemoryStack
and 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.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static NkUserFontGlyph.Buffer callocStack(int capacity)
Returns a newNkUserFontGlyph.Buffer
instance allocated on the thread-localMemoryStack
and 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.Buffer
instance 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.Buffer
instance allocated on the specifiedMemoryStack
and 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
.
-
-