Package org.lwjgl.bgfx
Class BGFXInit
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.bgfx.BGFXInit
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,org.lwjgl.system.NativeResource
,org.lwjgl.system.Pointer
public class BGFXInit extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResource
Initialization parameters used byinit
.Member documentation
type
– select rendering backend. When set toRENDERER_TYPE_COUNT
a default rendering backend will be selected appropriate to the platform. One of:vendorId
– vendor PCI id. If set toPCI_ID_NONE
it will select the first device. One of:PCI_ID_NONE
PCI_ID_SOFTWARE_RASTERIZER
PCI_ID_AMD
PCI_ID_INTEL
PCI_ID_NVIDIA
deviceId
– device id. If set to 0 it will select first device, or device with matching id.debug
– enable device for debuggingprofile
– enable device for profilingplatformData
– platform dataresolution
– backbuffer resolution and reset parameterscallback
– provide application specific callback interfaceallocator
– custom allocator. When a custom allocator is not specified, bgfx uses the CRT allocator. Bgfx assumes custom allocator is thread safe.
Layout
struct bgfx_init_t { bgfx_renderer_type_t type; uint16_t vendorId; uint16_t deviceId; bool debug; bool profile;
bgfx_platform_data_t
platformData;bgfx_resolution_t
resolution;bgfx_init_limits_t
limits;bgfx_callback_interface_t
* callback;bgfx_allocator_interface_t
* allocator; }
-
-
Field Summary
Fields Modifier and Type Field Description static int
ALIGNOF
The struct alignment in bytes.static int
ALLOCATOR
CALLBACK
DEBUG
DEVICEID
LIMITS
PLATFORMDATA
PROFILE
RESOLUTIONThe struct member offsets.static int
SIZEOF
The struct size in bytes.static int
TYPE
VENDORIDThe struct member offsets.
-
Constructor Summary
Constructors Constructor Description BGFXInit(java.nio.ByteBuffer container)
Creates aBGFXInit
instance at the current position of the specifiedByteBuffer
container.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description BGFXAllocatorInterface
allocator()
Returns aBGFXAllocatorInterface
view of the struct pointed to by theallocator
field.BGFXInit
allocator(BGFXAllocatorInterface value)
Sets the address of the specifiedBGFXAllocatorInterface
to theallocator
field.BGFXCallbackInterface
callback()
Returns aBGFXCallbackInterface
view of the struct pointed to by thecallback
field.BGFXInit
callback(BGFXCallbackInterface value)
Sets the address of the specifiedBGFXCallbackInterface
to thecallback
field.static BGFXInit
calloc()
Returns a newBGFXInit
instance allocated withmemCalloc
.static BGFXInit
callocStack()
Returns a newBGFXInit
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static BGFXInit
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newBGFXInit
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static BGFXInit
create()
Returns a newBGFXInit
instance allocated withBufferUtils
.static BGFXInit
create(long address)
Returns a newBGFXInit
instance for the specified memory address.static BGFXInit
createSafe(long address)
boolean
debug()
Returns the value of thedebug
field.BGFXInit
debug(boolean value)
Sets the specified value to thedebug
field.short
deviceId()
Returns the value of thedeviceId
field.BGFXInit
deviceId(short value)
Sets the specified value to thedeviceId
field.BGFXInitLimits
limits()
Returns aBGFXInitLimits
view of thelimits
field.BGFXInit
limits(java.util.function.Consumer<BGFXInitLimits> consumer)
Passes thelimits
field to the specifiedConsumer
.BGFXInit
limits(BGFXInitLimits value)
Copies the specifiedBGFXInitLimits
to thelimits
field.static BGFXInit
malloc()
Returns a newBGFXInit
instance allocated withmemAlloc
.static BGFXInit
mallocStack()
Returns a newBGFXInit
instance allocated on the thread-localMemoryStack
.static BGFXInit
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newBGFXInit
instance allocated on the specifiedMemoryStack
.static BGFXAllocatorInterface
nallocator(long struct)
Unsafe version ofallocator()
.static void
nallocator(long struct, BGFXAllocatorInterface value)
Unsafe version ofallocator
.static BGFXCallbackInterface
ncallback(long struct)
Unsafe version ofcallback()
.static void
ncallback(long struct, BGFXCallbackInterface value)
Unsafe version ofcallback
.static boolean
ndebug(long struct)
Unsafe version ofdebug()
.static void
ndebug(long struct, boolean value)
Unsafe version ofdebug
.static short
ndeviceId(long struct)
Unsafe version ofdeviceId()
.static void
ndeviceId(long struct, short value)
Unsafe version ofdeviceId
.static BGFXInitLimits
nlimits(long struct)
Unsafe version oflimits()
.static void
nlimits(long struct, BGFXInitLimits value)
Unsafe version oflimits
.static BGFXPlatformData
nplatformData(long struct)
Unsafe version ofplatformData()
.static void
nplatformData(long struct, BGFXPlatformData value)
Unsafe version ofplatformData
.static boolean
nprofile(long struct)
Unsafe version ofprofile()
.static void
nprofile(long struct, boolean value)
Unsafe version ofprofile
.static BGFXResolution
nresolution(long struct)
Unsafe version ofresolution()
.static void
nresolution(long struct, BGFXResolution value)
Unsafe version ofresolution
.static int
ntype(long struct)
Unsafe version oftype()
.static void
ntype(long struct, int value)
Unsafe version oftype
.static short
nvendorId(long struct)
Unsafe version ofvendorId()
.static void
nvendorId(long struct, short value)
Unsafe version ofvendorId
.BGFXPlatformData
platformData()
Returns aBGFXPlatformData
view of theplatformData
field.BGFXInit
platformData(java.util.function.Consumer<BGFXPlatformData> consumer)
Passes theplatformData
field to the specifiedConsumer
.BGFXInit
platformData(BGFXPlatformData value)
Copies the specifiedBGFXPlatformData
to theplatformData
field.boolean
profile()
Returns the value of theprofile
field.BGFXInit
profile(boolean value)
Sets the specified value to theprofile
field.BGFXResolution
resolution()
Returns aBGFXResolution
view of theresolution
field.BGFXInit
resolution(java.util.function.Consumer<BGFXResolution> consumer)
Passes theresolution
field to the specifiedConsumer
.BGFXInit
resolution(BGFXResolution value)
Copies the specifiedBGFXResolution
to theresolution
field.BGFXInit
set(int type, short vendorId, short deviceId, boolean debug, boolean profile, BGFXPlatformData platformData, BGFXResolution resolution, BGFXInitLimits limits, BGFXCallbackInterface callback, BGFXAllocatorInterface allocator)
Initializes this struct with the specified values.BGFXInit
set(BGFXInit src)
Copies the specified struct data to this struct.int
sizeof()
int
type()
Returns the value of thetype
field.BGFXInit
type(int value)
Sets the specified value to thetype
field.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.short
vendorId()
Returns the value of thevendorId
field.BGFXInit
vendorId(short value)
Sets the specified value to thevendorId
field.
-
-
-
Constructor Detail
-
BGFXInit
public BGFXInit(java.nio.ByteBuffer container)
Creates aBGFXInit
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
-
type
public int type()
Returns the value of thetype
field.
-
vendorId
public short vendorId()
Returns the value of thevendorId
field.
-
deviceId
public short deviceId()
Returns the value of thedeviceId
field.
-
debug
public boolean debug()
Returns the value of thedebug
field.
-
profile
public boolean profile()
Returns the value of theprofile
field.
-
platformData
public BGFXPlatformData platformData()
Returns aBGFXPlatformData
view of theplatformData
field.
-
resolution
public BGFXResolution resolution()
Returns aBGFXResolution
view of theresolution
field.
-
limits
public BGFXInitLimits limits()
Returns aBGFXInitLimits
view of thelimits
field.
-
callback
@Nullable public BGFXCallbackInterface callback()
Returns aBGFXCallbackInterface
view of the struct pointed to by thecallback
field.
-
allocator
@Nullable public BGFXAllocatorInterface allocator()
Returns aBGFXAllocatorInterface
view of the struct pointed to by theallocator
field.
-
type
public BGFXInit type(int value)
Sets the specified value to thetype
field.
-
vendorId
public BGFXInit vendorId(short value)
Sets the specified value to thevendorId
field.
-
deviceId
public BGFXInit deviceId(short value)
Sets the specified value to thedeviceId
field.
-
debug
public BGFXInit debug(boolean value)
Sets the specified value to thedebug
field.
-
profile
public BGFXInit profile(boolean value)
Sets the specified value to theprofile
field.
-
platformData
public BGFXInit platformData(BGFXPlatformData value)
Copies the specifiedBGFXPlatformData
to theplatformData
field.
-
platformData
public BGFXInit platformData(java.util.function.Consumer<BGFXPlatformData> consumer)
Passes theplatformData
field to the specifiedConsumer
.
-
resolution
public BGFXInit resolution(BGFXResolution value)
Copies the specifiedBGFXResolution
to theresolution
field.
-
resolution
public BGFXInit resolution(java.util.function.Consumer<BGFXResolution> consumer)
Passes theresolution
field to the specifiedConsumer
.
-
limits
public BGFXInit limits(BGFXInitLimits value)
Copies the specifiedBGFXInitLimits
to thelimits
field.
-
limits
public BGFXInit limits(java.util.function.Consumer<BGFXInitLimits> consumer)
Passes thelimits
field to the specifiedConsumer
.
-
callback
public BGFXInit callback(@Nullable BGFXCallbackInterface value)
Sets the address of the specifiedBGFXCallbackInterface
to thecallback
field.
-
allocator
public BGFXInit allocator(@Nullable BGFXAllocatorInterface value)
Sets the address of the specifiedBGFXAllocatorInterface
to theallocator
field.
-
set
public BGFXInit set(int type, short vendorId, short deviceId, boolean debug, boolean profile, BGFXPlatformData platformData, BGFXResolution resolution, BGFXInitLimits limits, @Nullable BGFXCallbackInterface callback, @Nullable BGFXAllocatorInterface allocator)
Initializes this struct with the specified values.
-
set
public BGFXInit set(BGFXInit src)
Copies the specified struct data to this struct.- Parameters:
src
- the source struct- Returns:
- this struct
-
malloc
public static BGFXInit malloc()
Returns a newBGFXInit
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static BGFXInit calloc()
Returns a newBGFXInit
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static BGFXInit create()
Returns a newBGFXInit
instance allocated withBufferUtils
.
-
create
public static BGFXInit create(long address)
Returns a newBGFXInit
instance for the specified memory address.
-
createSafe
@Nullable public static BGFXInit createSafe(long address)
-
mallocStack
public static BGFXInit mallocStack()
Returns a newBGFXInit
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static BGFXInit callocStack()
Returns a newBGFXInit
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static BGFXInit mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newBGFXInit
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static BGFXInit callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newBGFXInit
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
ntype
public static int ntype(long struct)
Unsafe version oftype()
.
-
nvendorId
public static short nvendorId(long struct)
Unsafe version ofvendorId()
.
-
ndeviceId
public static short ndeviceId(long struct)
Unsafe version ofdeviceId()
.
-
ndebug
public static boolean ndebug(long struct)
Unsafe version ofdebug()
.
-
nprofile
public static boolean nprofile(long struct)
Unsafe version ofprofile()
.
-
nplatformData
public static BGFXPlatformData nplatformData(long struct)
Unsafe version ofplatformData()
.
-
nresolution
public static BGFXResolution nresolution(long struct)
Unsafe version ofresolution()
.
-
nlimits
public static BGFXInitLimits nlimits(long struct)
Unsafe version oflimits()
.
-
ncallback
@Nullable public static BGFXCallbackInterface ncallback(long struct)
Unsafe version ofcallback()
.
-
nallocator
@Nullable public static BGFXAllocatorInterface nallocator(long struct)
Unsafe version ofallocator()
.
-
ntype
public static void ntype(long struct, int value)
Unsafe version oftype
.
-
nvendorId
public static void nvendorId(long struct, short value)
Unsafe version ofvendorId
.
-
ndeviceId
public static void ndeviceId(long struct, short value)
Unsafe version ofdeviceId
.
-
ndebug
public static void ndebug(long struct, boolean value)
Unsafe version ofdebug
.
-
nprofile
public static void nprofile(long struct, boolean value)
Unsafe version ofprofile
.
-
nplatformData
public static void nplatformData(long struct, BGFXPlatformData value)
Unsafe version ofplatformData
.
-
nresolution
public static void nresolution(long struct, BGFXResolution value)
Unsafe version ofresolution
.
-
nlimits
public static void nlimits(long struct, BGFXInitLimits value)
Unsafe version oflimits
.
-
ncallback
public static void ncallback(long struct, @Nullable BGFXCallbackInterface value)
Unsafe version ofcallback
.
-
nallocator
public static void nallocator(long struct, @Nullable BGFXAllocatorInterface value)
Unsafe version ofallocator
.
-
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
-
-