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.NativeResourceThe opaquestbrp_contextstruct.Member documentation
extra[2]– we allocate two extra nodes so optimal user-node-count iswidthnotwidth+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_nodeextra[2]; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSTBRPContext.BufferAn array ofSTBRPContextstructs.
-
Field Summary
Fields Modifier and Type Field Description static intACTIVE_HEAD
ALIGNThe struct member offsets.static intALIGNOFThe struct alignment in bytes.static intEXTRA
FREE_HEAD
HEIGHT
HEURISTIC
INIT_MODE
NUM_NODESThe struct member offsets.static intSIZEOFThe struct size in bytes.static intWIDTHThe struct member offsets.
-
Constructor Summary
Constructors Constructor Description STBRPContext(java.nio.ByteBuffer container)Creates aSTBRPContextinstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description STBRPNodeactive_head()Returns aSTBRPNodeview of the struct pointed to by theactive_headfield.intalign()Returns the value of thealignfield.static STBRPContextcalloc()Returns a newSTBRPContextinstance allocated withmemCalloc.static STBRPContext.Buffercalloc(int capacity)Returns a newSTBRPContext.Bufferinstance allocated withmemCalloc.static STBRPContextcallocStack()Returns a newSTBRPContextinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static STBRPContext.BuffercallocStack(int capacity)Returns a newSTBRPContext.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static STBRPContext.BuffercallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newSTBRPContext.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static STBRPContextcallocStack(org.lwjgl.system.MemoryStack stack)Returns a newSTBRPContextinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static STBRPContextcreate()Returns a newSTBRPContextinstance allocated withBufferUtils.static STBRPContext.Buffercreate(int capacity)Returns a newSTBRPContext.Bufferinstance allocated withBufferUtils.static STBRPContextcreate(long address)Returns a newSTBRPContextinstance for the specified memory address.static STBRPContext.Buffercreate(long address, int capacity)Create aSTBRPContext.Bufferinstance at the specified memory.static STBRPContextcreateSafe(long address)static STBRPContext.BuffercreateSafe(long address, int capacity)STBRPNode.Bufferextra()Returns aSTBRPNode.Buffer view of theextrafield.STBRPNodeextra(int index)Returns aSTBRPNodeview of the struct at the specified index of theextrafield.STBRPNodefree_head()Returns aSTBRPNodeview of the struct pointed to by thefree_headfield.intheight()Returns the value of theheightfield.intheuristic()Returns the value of theheuristicfield.intinit_mode()Returns the value of theinit_modefield.static STBRPContextmalloc()Returns a newSTBRPContextinstance allocated withmemAlloc.static STBRPContext.Buffermalloc(int capacity)Returns a newSTBRPContext.Bufferinstance allocated withmemAlloc.static STBRPContextmallocStack()Returns a newSTBRPContextinstance allocated on the thread-localMemoryStack.static STBRPContext.BuffermallocStack(int capacity)Returns a newSTBRPContext.Bufferinstance allocated on the thread-localMemoryStack.static STBRPContext.BuffermallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newSTBRPContext.Bufferinstance allocated on the specifiedMemoryStack.static STBRPContextmallocStack(org.lwjgl.system.MemoryStack stack)Returns a newSTBRPContextinstance allocated on the specifiedMemoryStack.static STBRPNodenactive_head(long struct)Unsafe version ofactive_head().static intnalign(long struct)Unsafe version ofalign().static STBRPNode.Buffernextra(long struct)Unsafe version ofextra().static STBRPNodenextra(long struct, int index)Unsafe version ofextra.static STBRPNodenfree_head(long struct)Unsafe version offree_head().static intnheight(long struct)Unsafe version ofheight().static intnheuristic(long struct)Unsafe version ofheuristic().static intninit_mode(long struct)Unsafe version ofinit_mode().static intnnum_nodes(long struct)Unsafe version ofnum_nodes().intnum_nodes()Returns the value of thenum_nodesfield.static intnwidth(long struct)Unsafe version ofwidth().intsizeof()intwidth()Returns the value of thewidthfield.
-
-
-
Constructor Detail
-
STBRPContext
public STBRPContext(java.nio.ByteBuffer container)
Creates aSTBRPContextinstance at the current position of the specifiedByteBuffercontainer. 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:
sizeofin classorg.lwjgl.system.Struct
-
width
public int width()
Returns the value of thewidthfield.
-
height
public int height()
Returns the value of theheightfield.
-
align
public int align()
Returns the value of thealignfield.
-
init_mode
public int init_mode()
Returns the value of theinit_modefield.
-
heuristic
public int heuristic()
Returns the value of theheuristicfield.
-
num_nodes
public int num_nodes()
Returns the value of thenum_nodesfield.
-
active_head
@Nullable public STBRPNode active_head()
Returns aSTBRPNodeview of the struct pointed to by theactive_headfield.
-
free_head
@Nullable public STBRPNode free_head()
Returns aSTBRPNodeview of the struct pointed to by thefree_headfield.
-
extra
public STBRPNode.Buffer extra()
Returns aSTBRPNode.Buffer view of theextrafield.
-
extra
public STBRPNode extra(int index)
Returns aSTBRPNodeview of the struct at the specified index of theextrafield.
-
malloc
public static STBRPContext malloc()
Returns a newSTBRPContextinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static STBRPContext calloc()
Returns a newSTBRPContextinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static STBRPContext create()
Returns a newSTBRPContextinstance allocated withBufferUtils.
-
create
public static STBRPContext create(long address)
Returns a newSTBRPContextinstance for the specified memory address.
-
createSafe
@Nullable public static STBRPContext createSafe(long address)
-
malloc
public static STBRPContext.Buffer malloc(int capacity)
Returns a newSTBRPContext.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static STBRPContext.Buffer calloc(int capacity)
Returns a newSTBRPContext.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static STBRPContext.Buffer create(int capacity)
Returns a newSTBRPContext.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static STBRPContext.Buffer create(long address, int capacity)
Create aSTBRPContext.Bufferinstance 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 newSTBRPContextinstance allocated on the thread-localMemoryStack.
-
callocStack
public static STBRPContext callocStack()
Returns a newSTBRPContextinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.
-
mallocStack
public static STBRPContext mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newSTBRPContextinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
callocStack
public static STBRPContext callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newSTBRPContextinstance allocated on the specifiedMemoryStackand 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.Bufferinstance allocated on the thread-localMemoryStack.- Parameters:
capacity- the buffer capacity
-
callocStack
public static STBRPContext.Buffer callocStack(int capacity)
Returns a newSTBRPContext.Bufferinstance allocated on the thread-localMemoryStackand 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.Bufferinstance 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.Bufferinstance allocated on the specifiedMemoryStackand 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().
-
-