Package org.lwjgl.bgfx
Class BGFXMemory
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.bgfx.BGFXMemory
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,org.lwjgl.system.NativeResource
,org.lwjgl.system.Pointer
public class BGFXMemory extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResource
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BGFXMemory.Buffer
An array ofBGFXMemory
structs.
-
Constructor Summary
Constructors Constructor Description BGFXMemory(java.nio.ByteBuffer container)
Creates aBGFXMemory
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 BGFXMemory
calloc()
Returns a newBGFXMemory
instance allocated withmemCalloc
.static BGFXMemory.Buffer
calloc(int capacity)
Returns a newBGFXMemory.Buffer
instance allocated withmemCalloc
.static BGFXMemory
callocStack()
Returns a newBGFXMemory
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static BGFXMemory.Buffer
callocStack(int capacity)
Returns a newBGFXMemory.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static BGFXMemory.Buffer
callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newBGFXMemory.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static BGFXMemory
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newBGFXMemory
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static BGFXMemory
create()
Returns a newBGFXMemory
instance allocated withBufferUtils
.static BGFXMemory.Buffer
create(int capacity)
Returns a newBGFXMemory.Buffer
instance allocated withBufferUtils
.static BGFXMemory
create(long address)
Returns a newBGFXMemory
instance for the specified memory address.static BGFXMemory.Buffer
create(long address, int capacity)
Create aBGFXMemory.Buffer
instance at the specified memory.static BGFXMemory
createSafe(long address)
static BGFXMemory.Buffer
createSafe(long address, int capacity)
java.nio.ByteBuffer
data()
Returns aByteBuffer
view of the data pointed to by thedata
field.BGFXMemory
data(java.nio.ByteBuffer value)
Sets the address of the specifiedByteBuffer
to thedata
field.static BGFXMemory
malloc()
Returns a newBGFXMemory
instance allocated withmemAlloc
.static BGFXMemory.Buffer
malloc(int capacity)
Returns a newBGFXMemory.Buffer
instance allocated withmemAlloc
.static BGFXMemory
mallocStack()
Returns a newBGFXMemory
instance allocated on the thread-localMemoryStack
.static BGFXMemory.Buffer
mallocStack(int capacity)
Returns a newBGFXMemory.Buffer
instance allocated on the thread-localMemoryStack
.static BGFXMemory.Buffer
mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newBGFXMemory.Buffer
instance allocated on the specifiedMemoryStack
.static BGFXMemory
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newBGFXMemory
instance allocated on the specifiedMemoryStack
.static java.nio.ByteBuffer
ndata(long struct)
Unsafe version ofdata
.static void
ndata(long struct, java.nio.ByteBuffer value)
Unsafe version ofdata
.static int
nsize(long struct)
Unsafe version ofsize()
.static void
nsize(long struct, int value)
Sets the specified value to thesize
field of the specifiedstruct
.BGFXMemory
set(BGFXMemory src)
Copies the specified struct data to this struct.int
size()
Returns the value of thesize
field.int
sizeof()
static void
validate(long struct)
Validates pointer members that should not beNULL
.static void
validate(long array, int count)
Callsvalidate(long)
for each struct contained in the specified struct array.
-
-
-
Constructor Detail
-
BGFXMemory
public BGFXMemory(java.nio.ByteBuffer container)
Creates aBGFXMemory
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
-
data
public java.nio.ByteBuffer data()
Returns aByteBuffer
view of the data pointed to by thedata
field.
-
size
public int size()
Returns the value of thesize
field.
-
data
public BGFXMemory data(java.nio.ByteBuffer value)
Sets the address of the specifiedByteBuffer
to thedata
field.
-
set
public BGFXMemory set(BGFXMemory src)
Copies the specified struct data to this struct.- Parameters:
src
- the source struct- Returns:
- this struct
-
malloc
public static BGFXMemory malloc()
Returns a newBGFXMemory
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static BGFXMemory calloc()
Returns a newBGFXMemory
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static BGFXMemory create()
Returns a newBGFXMemory
instance allocated withBufferUtils
.
-
create
public static BGFXMemory create(long address)
Returns a newBGFXMemory
instance for the specified memory address.
-
createSafe
@Nullable public static BGFXMemory createSafe(long address)
-
malloc
public static BGFXMemory.Buffer malloc(int capacity)
Returns a newBGFXMemory.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static BGFXMemory.Buffer calloc(int capacity)
Returns a newBGFXMemory.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static BGFXMemory.Buffer create(int capacity)
Returns a newBGFXMemory.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static BGFXMemory.Buffer create(long address, int capacity)
Create aBGFXMemory.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
createSafe
@Nullable public static BGFXMemory.Buffer createSafe(long address, int capacity)
-
mallocStack
public static BGFXMemory mallocStack()
Returns a newBGFXMemory
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static BGFXMemory callocStack()
Returns a newBGFXMemory
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static BGFXMemory mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newBGFXMemory
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static BGFXMemory callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newBGFXMemory
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
mallocStack
public static BGFXMemory.Buffer mallocStack(int capacity)
Returns a newBGFXMemory.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static BGFXMemory.Buffer callocStack(int capacity)
Returns a newBGFXMemory.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.- Parameters:
capacity
- the buffer capacity
-
mallocStack
public static BGFXMemory.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newBGFXMemory.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
callocStack
public static BGFXMemory.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newBGFXMemory.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
ndata
public static java.nio.ByteBuffer ndata(long struct)
Unsafe version ofdata
.
-
nsize
public static int nsize(long struct)
Unsafe version ofsize()
.
-
ndata
public static void ndata(long struct, java.nio.ByteBuffer value)
Unsafe version ofdata
.
-
nsize
public static void nsize(long struct, int value)
Sets the specified value to thesize
field of the specifiedstruct
.
-
validate
public static void validate(long struct)
Validates pointer members that should not beNULL
.- Parameters:
struct
- the struct to validate
-
validate
public static void validate(long array, int count)
Callsvalidate(long)
for each struct contained in the specified struct array.- Parameters:
array
- the struct array to validatecount
- the number of structs inarray
-
-