Package org.lwjgl.nuklear
Class NkHandle
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.nuklear.NkHandle
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,org.lwjgl.system.NativeResource
,org.lwjgl.system.Pointer
public class NkHandle extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResource
Layout
union nk_handle { void * ptr; int id; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
NkHandle.Buffer
An array ofNkHandle
structs.
-
Constructor Summary
Constructors Constructor Description NkHandle(java.nio.ByteBuffer container)
Creates aNkHandle
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 NkHandle
calloc()
Returns a newNkHandle
instance allocated withmemCalloc
.static NkHandle.Buffer
calloc(int capacity)
Returns a newNkHandle.Buffer
instance allocated withmemCalloc
.static NkHandle
callocStack()
Returns a newNkHandle
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static NkHandle.Buffer
callocStack(int capacity)
Returns a newNkHandle.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static NkHandle.Buffer
callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newNkHandle.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static NkHandle
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newNkHandle
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static NkHandle
create()
Returns a newNkHandle
instance allocated withBufferUtils
.static NkHandle.Buffer
create(int capacity)
Returns a newNkHandle.Buffer
instance allocated withBufferUtils
.static NkHandle
create(long address)
Returns a newNkHandle
instance for the specified memory address.static NkHandle.Buffer
create(long address, int capacity)
Create aNkHandle.Buffer
instance at the specified memory.static NkHandle
createSafe(long address)
static NkHandle.Buffer
createSafe(long address, int capacity)
int
id()
Returns the value of theid
field.NkHandle
id(int value)
Sets the specified value to theid
field.static NkHandle
malloc()
Returns a newNkHandle
instance allocated withmemAlloc
.static NkHandle.Buffer
malloc(int capacity)
Returns a newNkHandle.Buffer
instance allocated withmemAlloc
.static NkHandle
mallocStack()
Returns a newNkHandle
instance allocated on the thread-localMemoryStack
.static NkHandle.Buffer
mallocStack(int capacity)
Returns a newNkHandle.Buffer
instance allocated on the thread-localMemoryStack
.static NkHandle.Buffer
mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newNkHandle.Buffer
instance allocated on the specifiedMemoryStack
.static NkHandle
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newNkHandle
instance allocated on the specifiedMemoryStack
.static int
nid(long struct)
Unsafe version ofid()
.static void
nid(long struct, int value)
Unsafe version ofid
.static long
nptr(long struct)
Unsafe version ofptr()
.static void
nptr(long struct, long value)
Unsafe version ofptr
.long
ptr()
Returns the value of theptr
field.NkHandle
ptr(long value)
Sets the specified value to theptr
field.NkHandle
set(NkHandle src)
Copies the specified struct data to this struct.int
sizeof()
-
-
-
Constructor Detail
-
NkHandle
public NkHandle(java.nio.ByteBuffer container)
Creates aNkHandle
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
-
ptr
public long ptr()
Returns the value of theptr
field.
-
id
public int id()
Returns the value of theid
field.
-
ptr
public NkHandle ptr(long value)
Sets the specified value to theptr
field.
-
id
public NkHandle id(int value)
Sets the specified value to theid
field.
-
set
public NkHandle set(NkHandle src)
Copies the specified struct data to this struct.- Parameters:
src
- the source struct- Returns:
- this struct
-
malloc
public static NkHandle malloc()
Returns a newNkHandle
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static NkHandle calloc()
Returns a newNkHandle
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static NkHandle create()
Returns a newNkHandle
instance allocated withBufferUtils
.
-
create
public static NkHandle create(long address)
Returns a newNkHandle
instance for the specified memory address.
-
createSafe
@Nullable public static NkHandle createSafe(long address)
-
malloc
public static NkHandle.Buffer malloc(int capacity)
Returns a newNkHandle.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static NkHandle.Buffer calloc(int capacity)
Returns a newNkHandle.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static NkHandle.Buffer create(int capacity)
Returns a newNkHandle.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static NkHandle.Buffer create(long address, int capacity)
Create aNkHandle.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
createSafe
@Nullable public static NkHandle.Buffer createSafe(long address, int capacity)
-
mallocStack
public static NkHandle mallocStack()
Returns a newNkHandle
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static NkHandle callocStack()
Returns a newNkHandle
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static NkHandle mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newNkHandle
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static NkHandle callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newNkHandle
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
mallocStack
public static NkHandle.Buffer mallocStack(int capacity)
Returns a newNkHandle.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static NkHandle.Buffer callocStack(int capacity)
Returns a newNkHandle.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.- Parameters:
capacity
- the buffer capacity
-
mallocStack
public static NkHandle.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newNkHandle.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
callocStack
public static NkHandle.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newNkHandle.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
nptr
public static long nptr(long struct)
Unsafe version ofptr()
.
-
nid
public static int nid(long struct)
Unsafe version ofid()
.
-
nptr
public static void nptr(long struct, long value)
Unsafe version ofptr
.
-
nid
public static void nid(long struct, int value)
Unsafe version ofid
.
-
-