Package org.lwjgl.stb
Class STBRPContext
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.stb.STBRPContext
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,org.lwjgl.system.NativeResource
,org.lwjgl.system.Pointer
public class STBRPContext extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResource
The opaquestbrp_context
struct.Member documentation
extra[2]
– we allocate two extra nodes so optimal user-node-count iswidth
notwidth+2
Layout
struct stbrp_context { int width; int height; int align; int init_mode; int heuristic; int num_nodes;
stbrp_node
* active_head;stbrp_node
* free_head;stbrp_node
extra[2]; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
STBRPContext.Buffer
An array ofSTBRPContext
structs.
-
Field Summary
Fields Modifier and Type Field Description static int
ACTIVE_HEAD
ALIGNThe struct member offsets.static int
ALIGNOF
The struct alignment in bytes.static int
EXTRA
FREE_HEAD
HEIGHT
HEURISTIC
INIT_MODE
NUM_NODESThe struct member offsets.static int
SIZEOF
The struct size in bytes.static int
WIDTH
The struct member offsets.
-
Constructor Summary
Constructors Constructor Description STBRPContext(java.nio.ByteBuffer container)
Creates aSTBRPContext
instance at the current position of the specifiedByteBuffer
container.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description STBRPNode
active_head()
Returns aSTBRPNode
view of the struct pointed to by theactive_head
field.int
align()
Returns the value of thealign
field.static STBRPContext
calloc()
Returns a newSTBRPContext
instance allocated withmemCalloc
.static STBRPContext.Buffer
calloc(int capacity)
Returns a newSTBRPContext.Buffer
instance allocated withmemCalloc
.static STBRPContext
callocStack()
Returns a newSTBRPContext
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static STBRPContext.Buffer
callocStack(int capacity)
Returns a newSTBRPContext.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static STBRPContext.Buffer
callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newSTBRPContext.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static STBRPContext
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newSTBRPContext
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static STBRPContext
create()
Returns a newSTBRPContext
instance allocated withBufferUtils
.static STBRPContext.Buffer
create(int capacity)
Returns a newSTBRPContext.Buffer
instance allocated withBufferUtils
.static STBRPContext
create(long address)
Returns a newSTBRPContext
instance for the specified memory address.static STBRPContext.Buffer
create(long address, int capacity)
Create aSTBRPContext.Buffer
instance at the specified memory.static STBRPContext
createSafe(long address)
static STBRPContext.Buffer
createSafe(long address, int capacity)
STBRPNode.Buffer
extra()
Returns aSTBRPNode
.Buffer view of theextra
field.STBRPNode
extra(int index)
Returns aSTBRPNode
view of the struct at the specified index of theextra
field.STBRPNode
free_head()
Returns aSTBRPNode
view of the struct pointed to by thefree_head
field.int
height()
Returns the value of theheight
field.int
heuristic()
Returns the value of theheuristic
field.int
init_mode()
Returns the value of theinit_mode
field.static STBRPContext
malloc()
Returns a newSTBRPContext
instance allocated withmemAlloc
.static STBRPContext.Buffer
malloc(int capacity)
Returns a newSTBRPContext.Buffer
instance allocated withmemAlloc
.static STBRPContext
mallocStack()
Returns a newSTBRPContext
instance allocated on the thread-localMemoryStack
.static STBRPContext.Buffer
mallocStack(int capacity)
Returns a newSTBRPContext.Buffer
instance allocated on the thread-localMemoryStack
.static STBRPContext.Buffer
mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newSTBRPContext.Buffer
instance allocated on the specifiedMemoryStack
.static STBRPContext
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newSTBRPContext
instance allocated on the specifiedMemoryStack
.static STBRPNode
nactive_head(long struct)
Unsafe version ofactive_head()
.static int
nalign(long struct)
Unsafe version ofalign()
.static STBRPNode.Buffer
nextra(long struct)
Unsafe version ofextra()
.static STBRPNode
nextra(long struct, int index)
Unsafe version ofextra
.static STBRPNode
nfree_head(long struct)
Unsafe version offree_head()
.static int
nheight(long struct)
Unsafe version ofheight()
.static int
nheuristic(long struct)
Unsafe version ofheuristic()
.static int
ninit_mode(long struct)
Unsafe version ofinit_mode()
.static int
nnum_nodes(long struct)
Unsafe version ofnum_nodes()
.int
num_nodes()
Returns the value of thenum_nodes
field.static int
nwidth(long struct)
Unsafe version ofwidth()
.int
sizeof()
int
width()
Returns the value of thewidth
field.
-
-
-
Constructor Detail
-
STBRPContext
public STBRPContext(java.nio.ByteBuffer container)
Creates aSTBRPContext
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
-
width
public int width()
Returns the value of thewidth
field.
-
height
public int height()
Returns the value of theheight
field.
-
align
public int align()
Returns the value of thealign
field.
-
init_mode
public int init_mode()
Returns the value of theinit_mode
field.
-
heuristic
public int heuristic()
Returns the value of theheuristic
field.
-
num_nodes
public int num_nodes()
Returns the value of thenum_nodes
field.
-
active_head
@Nullable public STBRPNode active_head()
Returns aSTBRPNode
view of the struct pointed to by theactive_head
field.
-
free_head
@Nullable public STBRPNode free_head()
Returns aSTBRPNode
view of the struct pointed to by thefree_head
field.
-
extra
public STBRPNode.Buffer extra()
Returns aSTBRPNode
.Buffer view of theextra
field.
-
extra
public STBRPNode extra(int index)
Returns aSTBRPNode
view of the struct at the specified index of theextra
field.
-
malloc
public static STBRPContext malloc()
Returns a newSTBRPContext
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static STBRPContext calloc()
Returns a newSTBRPContext
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static STBRPContext create()
Returns a newSTBRPContext
instance allocated withBufferUtils
.
-
create
public static STBRPContext create(long address)
Returns a newSTBRPContext
instance for the specified memory address.
-
createSafe
@Nullable public static STBRPContext createSafe(long address)
-
malloc
public static STBRPContext.Buffer malloc(int capacity)
Returns a newSTBRPContext.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static STBRPContext.Buffer calloc(int capacity)
Returns a newSTBRPContext.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static STBRPContext.Buffer create(int capacity)
Returns a newSTBRPContext.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static STBRPContext.Buffer create(long address, int capacity)
Create aSTBRPContext.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
createSafe
@Nullable public static STBRPContext.Buffer createSafe(long address, int capacity)
-
mallocStack
public static STBRPContext mallocStack()
Returns a newSTBRPContext
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static STBRPContext callocStack()
Returns a newSTBRPContext
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static STBRPContext mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newSTBRPContext
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static STBRPContext callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newSTBRPContext
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
mallocStack
public static STBRPContext.Buffer mallocStack(int capacity)
Returns a newSTBRPContext.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static STBRPContext.Buffer callocStack(int capacity)
Returns a newSTBRPContext.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.- Parameters:
capacity
- the buffer capacity
-
mallocStack
public static STBRPContext.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newSTBRPContext.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
callocStack
public static STBRPContext.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newSTBRPContext.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
nwidth
public static int nwidth(long struct)
Unsafe version ofwidth()
.
-
nheight
public static int nheight(long struct)
Unsafe version ofheight()
.
-
nalign
public static int nalign(long struct)
Unsafe version ofalign()
.
-
ninit_mode
public static int ninit_mode(long struct)
Unsafe version ofinit_mode()
.
-
nheuristic
public static int nheuristic(long struct)
Unsafe version ofheuristic()
.
-
nnum_nodes
public static int nnum_nodes(long struct)
Unsafe version ofnum_nodes()
.
-
nactive_head
@Nullable public static STBRPNode nactive_head(long struct)
Unsafe version ofactive_head()
.
-
nfree_head
@Nullable public static STBRPNode nfree_head(long struct)
Unsafe version offree_head()
.
-
nextra
public static STBRPNode.Buffer nextra(long struct)
Unsafe version ofextra()
.
-
-