Package org.lwjgl.stb
Class STBRPRect
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.stb.STBRPRect
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,org.lwjgl.system.NativeResource
,org.lwjgl.system.Pointer
public class STBRPRect extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResource
A packed rectangle.Member documentation
id
– reserved for your usew
– input widthh
– input heightx
– output x coordinatey
– output y coordinatewas_packed
– non-zero if valid packing
Layout
struct stbrp_rect { int id; stbrp_coord w; stbrp_coord h; stbrp_coord x; stbrp_coord y; int was_packed; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
STBRPRect.Buffer
An array ofSTBRPRect
structs.
-
Constructor Summary
Constructors Constructor Description STBRPRect(java.nio.ByteBuffer container)
Creates aSTBRPRect
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 STBRPRect
calloc()
Returns a newSTBRPRect
instance allocated withmemCalloc
.static STBRPRect.Buffer
calloc(int capacity)
Returns a newSTBRPRect.Buffer
instance allocated withmemCalloc
.static STBRPRect
callocStack()
Returns a newSTBRPRect
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static STBRPRect.Buffer
callocStack(int capacity)
Returns a newSTBRPRect.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static STBRPRect.Buffer
callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newSTBRPRect.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static STBRPRect
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newSTBRPRect
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static STBRPRect
create()
Returns a newSTBRPRect
instance allocated withBufferUtils
.static STBRPRect.Buffer
create(int capacity)
Returns a newSTBRPRect.Buffer
instance allocated withBufferUtils
.static STBRPRect
create(long address)
Returns a newSTBRPRect
instance for the specified memory address.static STBRPRect.Buffer
create(long address, int capacity)
Create aSTBRPRect.Buffer
instance at the specified memory.static STBRPRect
createSafe(long address)
static STBRPRect.Buffer
createSafe(long address, int capacity)
short
h()
Returns the value of theh
field.STBRPRect
h(short value)
Sets the specified value to theh
field.int
id()
Returns the value of theid
field.STBRPRect
id(int value)
Sets the specified value to theid
field.static STBRPRect
malloc()
Returns a newSTBRPRect
instance allocated withmemAlloc
.static STBRPRect.Buffer
malloc(int capacity)
Returns a newSTBRPRect.Buffer
instance allocated withmemAlloc
.static STBRPRect
mallocStack()
Returns a newSTBRPRect
instance allocated on the thread-localMemoryStack
.static STBRPRect.Buffer
mallocStack(int capacity)
Returns a newSTBRPRect.Buffer
instance allocated on the thread-localMemoryStack
.static STBRPRect.Buffer
mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newSTBRPRect.Buffer
instance allocated on the specifiedMemoryStack
.static STBRPRect
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newSTBRPRect
instance allocated on the specifiedMemoryStack
.static short
nh(long struct)
Unsafe version ofh()
.static void
nh(long struct, short value)
Unsafe version ofh
.static int
nid(long struct)
Unsafe version ofid()
.static void
nid(long struct, int value)
Unsafe version ofid
.static short
nw(long struct)
Unsafe version ofw()
.static void
nw(long struct, short value)
Unsafe version ofw
.static int
nwas_packed(long struct)
Unsafe version ofwas_packed()
.static void
nwas_packed(long struct, int value)
Unsafe version ofwas_packed
.static short
nx(long struct)
Unsafe version ofx()
.static void
nx(long struct, short value)
Unsafe version ofx
.static short
ny(long struct)
Unsafe version ofy()
.static void
ny(long struct, short value)
Unsafe version ofy
.STBRPRect
set(int id, short w, short h, short x, short y, boolean was_packed)
Initializes this struct with the specified values.STBRPRect
set(STBRPRect src)
Copies the specified struct data to this struct.int
sizeof()
short
w()
Returns the value of thew
field.STBRPRect
w(short value)
Sets the specified value to thew
field.boolean
was_packed()
Returns the value of thewas_packed
field.STBRPRect
was_packed(boolean value)
Sets the specified value to thewas_packed
field.short
x()
Returns the value of thex
field.STBRPRect
x(short value)
Sets the specified value to thex
field.short
y()
Returns the value of they
field.STBRPRect
y(short value)
Sets the specified value to they
field.
-
-
-
Constructor Detail
-
STBRPRect
public STBRPRect(java.nio.ByteBuffer container)
Creates aSTBRPRect
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
-
id
public int id()
Returns the value of theid
field.
-
w
public short w()
Returns the value of thew
field.
-
h
public short h()
Returns the value of theh
field.
-
x
public short x()
Returns the value of thex
field.
-
y
public short y()
Returns the value of they
field.
-
was_packed
public boolean was_packed()
Returns the value of thewas_packed
field.
-
id
public STBRPRect id(int value)
Sets the specified value to theid
field.
-
w
public STBRPRect w(short value)
Sets the specified value to thew
field.
-
h
public STBRPRect h(short value)
Sets the specified value to theh
field.
-
x
public STBRPRect x(short value)
Sets the specified value to thex
field.
-
y
public STBRPRect y(short value)
Sets the specified value to they
field.
-
was_packed
public STBRPRect was_packed(boolean value)
Sets the specified value to thewas_packed
field.
-
set
public STBRPRect set(int id, short w, short h, short x, short y, boolean was_packed)
Initializes this struct with the specified values.
-
set
public STBRPRect set(STBRPRect src)
Copies the specified struct data to this struct.- Parameters:
src
- the source struct- Returns:
- this struct
-
malloc
public static STBRPRect malloc()
Returns a newSTBRPRect
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static STBRPRect calloc()
Returns a newSTBRPRect
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static STBRPRect create()
Returns a newSTBRPRect
instance allocated withBufferUtils
.
-
create
public static STBRPRect create(long address)
Returns a newSTBRPRect
instance for the specified memory address.
-
createSafe
@Nullable public static STBRPRect createSafe(long address)
-
malloc
public static STBRPRect.Buffer malloc(int capacity)
Returns a newSTBRPRect.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static STBRPRect.Buffer calloc(int capacity)
Returns a newSTBRPRect.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static STBRPRect.Buffer create(int capacity)
Returns a newSTBRPRect.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static STBRPRect.Buffer create(long address, int capacity)
Create aSTBRPRect.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
createSafe
@Nullable public static STBRPRect.Buffer createSafe(long address, int capacity)
-
mallocStack
public static STBRPRect mallocStack()
Returns a newSTBRPRect
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static STBRPRect callocStack()
Returns a newSTBRPRect
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static STBRPRect mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newSTBRPRect
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static STBRPRect callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newSTBRPRect
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
mallocStack
public static STBRPRect.Buffer mallocStack(int capacity)
Returns a newSTBRPRect.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static STBRPRect.Buffer callocStack(int capacity)
Returns a newSTBRPRect.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.- Parameters:
capacity
- the buffer capacity
-
mallocStack
public static STBRPRect.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newSTBRPRect.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
callocStack
public static STBRPRect.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newSTBRPRect.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
nid
public static int nid(long struct)
Unsafe version ofid()
.
-
nw
public static short nw(long struct)
Unsafe version ofw()
.
-
nh
public static short nh(long struct)
Unsafe version ofh()
.
-
nx
public static short nx(long struct)
Unsafe version ofx()
.
-
ny
public static short ny(long struct)
Unsafe version ofy()
.
-
nwas_packed
public static int nwas_packed(long struct)
Unsafe version ofwas_packed()
.
-
nid
public static void nid(long struct, int value)
Unsafe version ofid
.
-
nw
public static void nw(long struct, short value)
Unsafe version ofw
.
-
nh
public static void nh(long struct, short value)
Unsafe version ofh
.
-
nx
public static void nx(long struct, short value)
Unsafe version ofx
.
-
ny
public static void ny(long struct, short value)
Unsafe version ofy
.
-
nwas_packed
public static void nwas_packed(long struct, int value)
Unsafe version ofwas_packed
.
-
-