Package org.lwjgl.nanovg
Class UIVec2
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.nanovg.UIVec2
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,org.lwjgl.system.NativeResource
,org.lwjgl.system.Pointer
public class UIVec2 extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResource
for cursor positions, mainlyLayout
struct UIvec2 { union { int v[2]; struct { int x; int y; }; }; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
UIVec2.Buffer
An array ofUIVec2
structs.
-
Constructor Summary
Constructors Constructor Description UIVec2(java.nio.ByteBuffer container)
Creates aUIVec2
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 UIVec2
calloc()
Returns a newUIVec2
instance allocated withmemCalloc
.static UIVec2.Buffer
calloc(int capacity)
Returns a newUIVec2.Buffer
instance allocated withmemCalloc
.static UIVec2
callocStack()
Returns a newUIVec2
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static UIVec2.Buffer
callocStack(int capacity)
Returns a newUIVec2.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static UIVec2.Buffer
callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newUIVec2.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static UIVec2
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newUIVec2
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static UIVec2
create()
Returns a newUIVec2
instance allocated withBufferUtils
.static UIVec2.Buffer
create(int capacity)
Returns a newUIVec2.Buffer
instance allocated withBufferUtils
.static UIVec2
create(long address)
Returns a newUIVec2
instance for the specified memory address.static UIVec2.Buffer
create(long address, int capacity)
Create aUIVec2.Buffer
instance at the specified memory.static UIVec2
createSafe(long address)
static UIVec2.Buffer
createSafe(long address, int capacity)
static UIVec2
malloc()
Returns a newUIVec2
instance allocated withmemAlloc
.static UIVec2.Buffer
malloc(int capacity)
Returns a newUIVec2.Buffer
instance allocated withmemAlloc
.static UIVec2
mallocStack()
Returns a newUIVec2
instance allocated on the thread-localMemoryStack
.static UIVec2.Buffer
mallocStack(int capacity)
Returns a newUIVec2.Buffer
instance allocated on the thread-localMemoryStack
.static UIVec2.Buffer
mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newUIVec2.Buffer
instance allocated on the specifiedMemoryStack
.static UIVec2
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newUIVec2
instance allocated on the specifiedMemoryStack
.static java.nio.IntBuffer
nv(long struct)
Unsafe version ofv()
.static int
nv(long struct, int index)
Unsafe version ofv
.static void
nv(long struct, int index, int value)
Unsafe version ofv
.static void
nv(long struct, java.nio.IntBuffer value)
Unsafe version ofv
.static int
nx(long struct)
Unsafe version ofx()
.static void
nx(long struct, int value)
Unsafe version ofx
.static int
ny(long struct)
Unsafe version ofy()
.static void
ny(long struct, int value)
Unsafe version ofy
.UIVec2
set(UIVec2 src)
Copies the specified struct data to this struct.int
sizeof()
java.nio.IntBuffer
v()
Returns aIntBuffer
view of thev
field.int
v(int index)
Returns the value at the specified index of thev
field.UIVec2
v(int index, int value)
Sets the specified value at the specified index of thev
field.UIVec2
v(java.nio.IntBuffer value)
Copies the specifiedIntBuffer
to thev
field.int
x()
Returns the value of thex
field.UIVec2
x(int value)
Sets the specified value to thex
field.int
y()
Returns the value of they
field.UIVec2
y(int value)
Sets the specified value to they
field.
-
-
-
Constructor Detail
-
UIVec2
public UIVec2(java.nio.ByteBuffer container)
Creates aUIVec2
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
-
v
public java.nio.IntBuffer v()
Returns aIntBuffer
view of thev
field.
-
v
public int v(int index)
Returns the value at the specified index of thev
field.
-
x
public int x()
Returns the value of thex
field.
-
y
public int y()
Returns the value of they
field.
-
v
public UIVec2 v(java.nio.IntBuffer value)
Copies the specifiedIntBuffer
to thev
field.
-
v
public UIVec2 v(int index, int value)
Sets the specified value at the specified index of thev
field.
-
x
public UIVec2 x(int value)
Sets the specified value to thex
field.
-
y
public UIVec2 y(int value)
Sets the specified value to they
field.
-
set
public UIVec2 set(UIVec2 src)
Copies the specified struct data to this struct.- Parameters:
src
- the source struct- Returns:
- this struct
-
malloc
public static UIVec2 malloc()
Returns a newUIVec2
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static UIVec2 calloc()
Returns a newUIVec2
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static UIVec2 create()
Returns a newUIVec2
instance allocated withBufferUtils
.
-
create
public static UIVec2 create(long address)
Returns a newUIVec2
instance for the specified memory address.
-
createSafe
@Nullable public static UIVec2 createSafe(long address)
-
malloc
public static UIVec2.Buffer malloc(int capacity)
Returns a newUIVec2.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static UIVec2.Buffer calloc(int capacity)
Returns a newUIVec2.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static UIVec2.Buffer create(int capacity)
Returns a newUIVec2.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static UIVec2.Buffer create(long address, int capacity)
Create aUIVec2.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
createSafe
@Nullable public static UIVec2.Buffer createSafe(long address, int capacity)
-
mallocStack
public static UIVec2 mallocStack()
Returns a newUIVec2
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static UIVec2 callocStack()
Returns a newUIVec2
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static UIVec2 mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newUIVec2
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static UIVec2 callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newUIVec2
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
mallocStack
public static UIVec2.Buffer mallocStack(int capacity)
Returns a newUIVec2.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static UIVec2.Buffer callocStack(int capacity)
Returns a newUIVec2.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.- Parameters:
capacity
- the buffer capacity
-
mallocStack
public static UIVec2.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newUIVec2.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
callocStack
public static UIVec2.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newUIVec2.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
nv
public static java.nio.IntBuffer nv(long struct)
Unsafe version ofv()
.
-
nv
public static int nv(long struct, int index)
Unsafe version ofv
.
-
nx
public static int nx(long struct)
Unsafe version ofx()
.
-
ny
public static int ny(long struct)
Unsafe version ofy()
.
-
nv
public static void nv(long struct, java.nio.IntBuffer value)
Unsafe version ofv
.
-
nv
public static void nv(long struct, int index, int value)
Unsafe version ofv
.
-
nx
public static void nx(long struct, int value)
Unsafe version ofx
.
-
ny
public static void ny(long struct, int value)
Unsafe version ofy
.
-
-