Package org.lwjgl.nuklear
Class NkCursor
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.nuklear.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 ofNkCursor
structs.
-
Constructor Summary
Constructors Constructor Description NkCursor(java.nio.ByteBuffer container)
Creates aNkCursor
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 NkCursor
calloc()
Returns a newNkCursor
instance allocated withmemCalloc
.static NkCursor.Buffer
calloc(int capacity)
Returns a newNkCursor.Buffer
instance allocated withmemCalloc
.static NkCursor
callocStack()
Returns a newNkCursor
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static NkCursor.Buffer
callocStack(int capacity)
Returns a newNkCursor.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static NkCursor.Buffer
callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newNkCursor.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static NkCursor
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newNkCursor
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static NkCursor
create()
Returns a newNkCursor
instance allocated withBufferUtils
.static NkCursor.Buffer
create(int capacity)
Returns a newNkCursor.Buffer
instance allocated withBufferUtils
.static NkCursor
create(long address)
Returns a newNkCursor
instance for the specified memory address.static NkCursor.Buffer
create(long address, int capacity)
Create aNkCursor.Buffer
instance at the specified memory.static NkCursor
createSafe(long address)
static NkCursor.Buffer
createSafe(long address, int capacity)
NkImage
img()
Returns aNkImage
view of theimg
field.NkCursor
img(java.util.function.Consumer<NkImage> consumer)
Passes theimg
field to the specifiedConsumer
.NkCursor
img(NkImage value)
Copies the specifiedNkImage
to theimg
field.static NkCursor
malloc()
Returns a newNkCursor
instance allocated withmemAlloc
.static NkCursor.Buffer
malloc(int capacity)
Returns a newNkCursor.Buffer
instance allocated withmemAlloc
.static NkCursor
mallocStack()
Returns a newNkCursor
instance allocated on the thread-localMemoryStack
.static NkCursor.Buffer
mallocStack(int capacity)
Returns a newNkCursor.Buffer
instance allocated on the thread-localMemoryStack
.static NkCursor.Buffer
mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newNkCursor.Buffer
instance allocated on the specifiedMemoryStack
.static NkCursor
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newNkCursor
instance allocated on the specifiedMemoryStack
.static NkImage
nimg(long struct)
Unsafe version ofimg()
.static void
nimg(long struct, NkImage value)
Unsafe version ofimg
.static NkVec2
noffset(long struct)
Unsafe version ofoffset()
.static void
noffset(long struct, NkVec2 value)
Unsafe version ofoffset
.static NkVec2
nsize(long struct)
Unsafe version ofsize()
.static void
nsize(long struct, NkVec2 value)
Unsafe version ofsize
.NkVec2
offset()
Returns aNkVec2
view of theoffset
field.NkCursor
offset(java.util.function.Consumer<NkVec2> consumer)
Passes theoffset
field to the specifiedConsumer
.NkCursor
offset(NkVec2 value)
Copies the specifiedNkVec2
to theoffset
field.NkCursor
set(NkCursor src)
Copies the specified struct data to this struct.NkCursor
set(NkImage img, NkVec2 size, NkVec2 offset)
Initializes this struct with the specified values.NkVec2
size()
Returns aNkVec2
view of thesize
field.NkCursor
size(java.util.function.Consumer<NkVec2> consumer)
Passes thesize
field to the specifiedConsumer
.NkCursor
size(NkVec2 value)
Copies the specifiedNkVec2
to thesize
field.int
sizeof()
-
-
-
Constructor Detail
-
NkCursor
public NkCursor(java.nio.ByteBuffer container)
Creates aNkCursor
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
-
img
public NkCursor img(java.util.function.Consumer<NkImage> consumer)
Passes theimg
field to the specifiedConsumer
.
-
size
public NkCursor size(java.util.function.Consumer<NkVec2> consumer)
Passes thesize
field to the specifiedConsumer
.
-
offset
public NkCursor offset(java.util.function.Consumer<NkVec2> consumer)
Passes theoffset
field to the specifiedConsumer
.
-
set
public NkCursor set(NkImage img, NkVec2 size, NkVec2 offset)
Initializes this struct with the specified values.
-
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 newNkCursor
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static NkCursor calloc()
Returns a newNkCursor
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static NkCursor create()
Returns a newNkCursor
instance allocated withBufferUtils
.
-
create
public static NkCursor create(long address)
Returns a newNkCursor
instance for the specified memory address.
-
createSafe
@Nullable public static NkCursor createSafe(long address)
-
malloc
public static NkCursor.Buffer malloc(int capacity)
Returns a newNkCursor.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static NkCursor.Buffer calloc(int capacity)
Returns a newNkCursor.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static NkCursor.Buffer create(int capacity)
Returns a newNkCursor.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static NkCursor.Buffer create(long address, int capacity)
Create aNkCursor.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
createSafe
@Nullable public static NkCursor.Buffer createSafe(long address, int capacity)
-
mallocStack
public static NkCursor mallocStack()
Returns a newNkCursor
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static NkCursor callocStack()
Returns a newNkCursor
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static NkCursor mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newNkCursor
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static NkCursor callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newNkCursor
instance allocated on the specifiedMemoryStack
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 newNkCursor.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static NkCursor.Buffer callocStack(int capacity)
Returns a newNkCursor.Buffer
instance allocated on the thread-localMemoryStack
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 newNkCursor.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
callocStack
public static NkCursor.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newNkCursor.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
-