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 and Description static class
STBRPRect.Buffer
An array ofSTBRPRect
structs.
-
Field Summary
Fields Modifier and Type Field and Description static int
SIZEOF
The struct size in bytes.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and 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)
static STBRPRect.Buffer
create(long address, int capacity)
Create aSTBRPRect.Buffer
instance at the specified memory.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
.STBRPRect
nset(long struct)
Unsafe version ofset
.STBRPRect
set(int id, short w, short h, short x, short y, int was_packed)
Initializes this struct with the specified values.STBRPRect
set(STBRPRect src)
Copies the specified struct data to this struct.int
sizeof()
Returns thesizeof(struct)
.short
w()
Returns the value of thew
field.STBRPRect
w(short value)
Sets the specified value to thew
field.int
was_packed()
Returns the value of thewas_packed
field.STBRPRect
was_packed(int 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()
Description copied from class:org.lwjgl.system.Struct
Returns thesizeof(struct)
.- 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 int 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(int value)
Sets the specified value to thewas_packed
field.
-
set
public STBRPRect set(int id, short w, short h, short x, short y, int 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)
-
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
-
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
-
-