Top Description Fields Constructors Methods
org.lwjgl.bgfx

public Class BGFXInit

extends Struct<BGFXInit>
implements NativeResource
Class Inheritance
All Implemented Interfaces
org.lwjgl.system.NativeResource, java.lang.AutoCloseable
Annotations
@NativeType:struct bgfx_init_t
Imports
javax.annotation.*, java.nio.*, org.lwjgl.*, org.lwjgl.system.*

Initialization parameters used by init.

Layout


struct bgfx_init_t {
    bgfx_renderer_type_t type;
    uint16_t vendorId;
    uint16_t deviceId;
    uint64_t capabilities;
    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

Modifier and TypeField and Description
public static final int
ALIGNOF

The struct alignment in bytes.

public static final int
ALLOCATOR

The struct member offsets.

public static final int
CALLBACK

The struct member offsets.

public static final int
CAPABILITIES

The struct member offsets.

public static final int
DEBUG

The struct member offsets.

public static final int
DEVICEID

The struct member offsets.

public static final int
LIMITS

The struct member offsets.

public static final int
PLATFORMDATA

The struct member offsets.

public static final int
PROFILE

The struct member offsets.

public static final int
RESOLUTION

The struct member offsets.

public static final int
SIZEOF

The struct size in bytes.

public static final int
TYPE

The struct member offsets.

public static final int
VENDORID

The struct member offsets.

Inherited from org.lwjgl.system.Struct:
containerDEFAULT_ALIGN_ASDEFAULT_PACK_ALIGNMENT

Constructor Summary

AccessConstructor and Description
protected
BGFXInit(long address, ByteBuffer container)

public
BGFXInit(ByteBuffer container)

Creates a BGFXInit instance at the current position of the specified ByteBuffer container.

Method Summary

Modifier and TypeMethod and Description
public BGFXAllocatorInterface
allocator()

custom allocator.

public BGFXInit
allocator(BGFXAllocatorInterface value)

Sets the address of the specified BGFXAllocatorInterface to the allocator field.

public BGFXCallbackInterface
callback()

provide application specific callback interface

public BGFXInit
callback(BGFXCallbackInterface value)

Sets the address of the specified BGFXCallbackInterface to the callback field.

public static BGFXInit
calloc()

Returns a new BGFXInit instance allocated with memCalloc.

public static BGFXInit
calloc(MemoryStack
the stack from which to allocate
stack
)

Returns a new BGFXInit instance allocated on the specified MemoryStack and initializes all its bits to zero.

public static BGFXInit
callocStack()

Deprecated
Deprecated for removal in 3.4.0.
public static BGFXInit
callocStack(MemoryStack stack)

Deprecated
Deprecated for removal in 3.4.0.
public long
capabilities()

capabilities initialization mask (default: UINT64_MAX)

public BGFXInit
capabilities(long value)

Sets the specified value to the capabilities field.

protected BGFXInit
create(long
the struct memory address
address
,
ByteBuffer
an optional container buffer, to be referenced strongly by the struct instance.
container
)

Implements abstract org.lwjgl.system.Struct.create.

Similar to the constructor, but returns the exact type of the Struct subclass.
public static BGFXInit
create()

Returns a new BGFXInit instance allocated with BufferUtils.

public static BGFXInit
create(long address)

Returns a new BGFXInit instance for the specified memory address.

public static BGFXInit
createSafe(long address)

Like create, but returns null if address is NULL.

public boolean
debug()

enable device for debugging

public BGFXInit
debug(boolean value)

Sets the specified value to the debug field.

public short
deviceId()

device ID. If set to 0 it will select first device, or device with matching ID.

public BGFXInit
deviceId(short value)

Sets the specified value to the deviceId field.

public BGFXInitLimits
limits()

configurable runtime limits parameters

public BGFXInit
limits(BGFXInitLimits value)

Copies the specified BGFXInitLimits to the limits field.

public BGFXInit
limits(Consumer<BGFXInitLimits> consumer)

Passes the limits field to the specified Consumer.

public static BGFXInit
malloc()

Returns a new BGFXInit instance allocated with memAlloc.

public static BGFXInit
malloc(MemoryStack
the stack from which to allocate
stack
)

Returns a new BGFXInit instance allocated on the specified MemoryStack.

public static BGFXInit
mallocStack()

Deprecated
Deprecated for removal in 3.4.0.
public static BGFXInit
mallocStack(MemoryStack stack)

Deprecated
Deprecated for removal in 3.4.0.
public static BGFXAllocatorInterface
nallocator(long struct)

Unsafe version of allocator.

public static void
nallocator(long struct, BGFXAllocatorInterface value)

Unsafe version of allocator.

public static BGFXCallbackInterface
ncallback(long struct)

Unsafe version of callback.

public static void
ncallback(long struct, BGFXCallbackInterface value)

Unsafe version of callback.

public static long
ncapabilities(long struct)

Unsafe version of capabilities.

public static void
ncapabilities(long struct, long value)

Unsafe version of capabilities.

public static boolean
ndebug(long struct)

Unsafe version of debug.

public static void
ndebug(long struct, boolean value)

Unsafe version of debug.

public static short
ndeviceId(long struct)

Unsafe version of deviceId.

public static void
ndeviceId(long struct, short value)

Unsafe version of deviceId.

public static BGFXInitLimits
nlimits(long struct)

Unsafe version of limits.

public static void
nlimits(long struct, BGFXInitLimits value)

Unsafe version of limits.

public static BGFXPlatformData
nplatformData(long struct)

Unsafe version of platformData.

public static void
nplatformData(long struct, BGFXPlatformData value)

Unsafe version of platformData.

public static boolean
nprofile(long struct)

Unsafe version of profile.

public static void
nprofile(long struct, boolean value)

Unsafe version of profile.

public static BGFXResolution
nresolution(long struct)

Unsafe version of resolution.

public static void
nresolution(long struct, BGFXResolution value)

Unsafe version of resolution.

public static int
ntype(long struct)

Unsafe version of type.

public static void
ntype(long struct, int value)

Unsafe version of type.

public static short
nvendorId(long struct)

Unsafe version of vendorId.

public static void
nvendorId(long struct, short value)

Unsafe version of vendorId.

public BGFXPlatformData
platformData()

platform data

public BGFXInit
platformData(BGFXPlatformData value)

Copies the specified BGFXPlatformData to the platformData field.

public BGFXInit
platformData(Consumer<BGFXPlatformData> consumer)

Passes the platformData field to the specified Consumer.

public boolean
profile()

enable device for profiling

public BGFXInit
profile(boolean value)

Sets the specified value to the profile field.

public BGFXResolution
resolution()

backbuffer resolution and reset parameters

public BGFXInit
resolution(BGFXResolution value)

Copies the specified BGFXResolution to the resolution field.

public BGFXInit
resolution(Consumer<BGFXResolution> consumer)

Passes the resolution field to the specified Consumer.

public BGFXInit
set(int type, short vendorId, short deviceId, long capabilities, boolean debug, boolean profile, BGFXPlatformData platformData, BGFXResolution resolution, BGFXInitLimits limits, BGFXCallbackInterface callback, BGFXAllocatorInterface allocator)

Initializes this struct with the specified values.

public BGFXInit

Returns:

this struct
set
(BGFXInit
the source struct
src
)

Copies the specified struct data to this struct.

public int
sizeof()

Implements abstract org.lwjgl.system.Struct.sizeof.

Returns sizeof(struct).
public int
type()

select rendering backend.

public BGFXInit
type(int value)

Sets the specified value to the type field.

public static void
validate(long
the struct to validate
struct
)

Validates pointer members that should not be NULL.

public short
vendorId()

vendor PCI id. If set to PCI_ID_NONE it will select the first device.

public BGFXInit
vendorId(short value)

Sets the specified value to the vendorId field.

Inherited from org.lwjgl.system.Struct:
__array__array__array__checkContainer__checkMalloc__create__getContainer__getContainer__member__member__member__padding__padding__struct__struct__union__unionclearfreeisNullvalidate

Field Detail

ALIGNOFback to summary
public static final int ALIGNOF

The struct alignment in bytes.

ALLOCATORback to summary
public static final int ALLOCATOR

The struct member offsets.

CALLBACKback to summary
public static final int CALLBACK

The struct member offsets.

CAPABILITIESback to summary
public static final int CAPABILITIES

The struct member offsets.

DEBUGback to summary
public static final int DEBUG

The struct member offsets.

DEVICEIDback to summary
public static final int DEVICEID

The struct member offsets.

LIMITSback to summary
public static final int LIMITS

The struct member offsets.

PLATFORMDATAback to summary
public static final int PLATFORMDATA

The struct member offsets.

PROFILEback to summary
public static final int PROFILE

The struct member offsets.

RESOLUTIONback to summary
public static final int RESOLUTION

The struct member offsets.

SIZEOFback to summary
public static final int SIZEOF

The struct size in bytes.

TYPEback to summary
public static final int TYPE

The struct member offsets.

VENDORIDback to summary
public static final int VENDORID

The struct member offsets.

Constructor Detail

BGFXInitback to summary
protected BGFXInit(long address, ByteBuffer container)
BGFXInitback to summary
public BGFXInit(ByteBuffer container)

Creates a BGFXInit instance at the current position of the specified ByteBuffer 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

allocatorback to summary
public BGFXAllocatorInterface allocator()

custom allocator. When a custom allocator is not specified, bgfx uses the CRT allocator. Bgfx assumes custom allocator is thread safe.

Annotations
@Nullable
@NativeType:bgfx_allocator_interface_t *
allocatorback to summary
public BGFXInit allocator(BGFXAllocatorInterface value)

Sets the address of the specified BGFXAllocatorInterface to the allocator field.

callbackback to summary
public BGFXCallbackInterface callback()

provide application specific callback interface

Annotations
@Nullable
@NativeType:bgfx_callback_interface_t *
callbackback to summary
public BGFXInit callback(BGFXCallbackInterface value)

Sets the address of the specified BGFXCallbackInterface to the callback field.

callocback to summary
public static BGFXInit calloc()

Returns a new BGFXInit instance allocated with memCalloc. The instance must be explicitly freed.

callocback to summary
public static BGFXInit calloc(MemoryStack stack)

Returns a new BGFXInit instance allocated on the specified MemoryStack and initializes all its bits to zero.

Parameters
stack:MemoryStack

the stack from which to allocate

callocStackback to summary
public static BGFXInit callocStack()

Deprecated

Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.

Annotations
@Deprecated
callocStackback to summary
public static BGFXInit callocStack(MemoryStack stack)

Deprecated

Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.

Annotations
@Deprecated
capabilitiesback to summary
public long capabilities()

capabilities initialization mask (default: UINT64_MAX)

Annotations
@NativeType:uint64_t
capabilitiesback to summary
public BGFXInit capabilities(long value)

Sets the specified value to the capabilities field.

createback to summary
protected BGFXInit create(long address, ByteBuffer container)

Implements abstract org.lwjgl.system.Struct.create.

Doc from org.lwjgl.system.Struct.create.

Similar to the constructor, but returns the exact type of the Struct subclass.

Effectively, every Struct instance is a factory for more instances of the same type. This is used by StructBuffer.

Parameters
address:long

the struct memory address

container:ByteBuffer

an optional container buffer, to be referenced strongly by the struct instance.

Annotations
@Override
createback to summary
public static BGFXInit create()

Returns a new BGFXInit instance allocated with BufferUtils.

createback to summary
public static BGFXInit create(long address)

Returns a new BGFXInit instance for the specified memory address.

createSafeback to summary
public static BGFXInit createSafe(long address)

Like create, but returns null if address is NULL.

Annotations
@Nullable
debugback to summary
public boolean debug()

enable device for debugging

Annotations
@NativeType:bool
debugback to summary
public BGFXInit debug(boolean value)

Sets the specified value to the debug field.

deviceIdback to summary
public short deviceId()

device ID. If set to 0 it will select first device, or device with matching ID.

Annotations
@NativeType:uint16_t
deviceIdback to summary
public BGFXInit deviceId(short value)

Sets the specified value to the deviceId field.

limitsback to summary
public BGFXInitLimits limits()

configurable runtime limits parameters

Annotations
@NativeType:bgfx_init_limits_t
limitsback to summary
public BGFXInit limits(BGFXInitLimits value)

Copies the specified BGFXInitLimits to the limits field.

limitsback to summary
public BGFXInit limits(Consumer<BGFXInitLimits> consumer)

Passes the limits field to the specified Consumer.

mallocback to summary
public static BGFXInit malloc()

Returns a new BGFXInit instance allocated with memAlloc. The instance must be explicitly freed.

mallocback to summary
public static BGFXInit malloc(MemoryStack stack)

Returns a new BGFXInit instance allocated on the specified MemoryStack.

Parameters
stack:MemoryStack

the stack from which to allocate

mallocStackback to summary
public static BGFXInit mallocStack()

Deprecated

Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.

Annotations
@Deprecated
mallocStackback to summary
public static BGFXInit mallocStack(MemoryStack stack)

Deprecated

Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.

Annotations
@Deprecated
nallocatorback to summary
public static BGFXAllocatorInterface nallocator(long struct)

Unsafe version of allocator.

Annotations
@Nullable
nallocatorback to summary
public static void nallocator(long struct, BGFXAllocatorInterface value)

Unsafe version of allocator.

ncallbackback to summary
public static BGFXCallbackInterface ncallback(long struct)

Unsafe version of callback.

Annotations
@Nullable
ncallbackback to summary
public static void ncallback(long struct, BGFXCallbackInterface value)

Unsafe version of callback.

ncapabilitiesback to summary
public static long ncapabilities(long struct)

Unsafe version of capabilities.

ncapabilitiesback to summary
public static void ncapabilities(long struct, long value)

Unsafe version of capabilities.

ndebugback to summary
public static boolean ndebug(long struct)

Unsafe version of debug.

ndebugback to summary
public static void ndebug(long struct, boolean value)

Unsafe version of debug.

ndeviceIdback to summary
public static short ndeviceId(long struct)

Unsafe version of deviceId.

ndeviceIdback to summary
public static void ndeviceId(long struct, short value)

Unsafe version of deviceId.

nlimitsback to summary
public static BGFXInitLimits nlimits(long struct)

Unsafe version of limits.

nlimitsback to summary
public static void nlimits(long struct, BGFXInitLimits value)

Unsafe version of limits.

nplatformDataback to summary
public static BGFXPlatformData nplatformData(long struct)

Unsafe version of platformData.

nplatformDataback to summary
public static void nplatformData(long struct, BGFXPlatformData value)

Unsafe version of platformData.

nprofileback to summary
public static boolean nprofile(long struct)

Unsafe version of profile.

nprofileback to summary
public static void nprofile(long struct, boolean value)

Unsafe version of profile.

nresolutionback to summary
public static BGFXResolution nresolution(long struct)

Unsafe version of resolution.

nresolutionback to summary
public static void nresolution(long struct, BGFXResolution value)

Unsafe version of resolution.

ntypeback to summary
public static int ntype(long struct)

Unsafe version of type.

ntypeback to summary
public static void ntype(long struct, int value)

Unsafe version of type.

nvendorIdback to summary
public static short nvendorId(long struct)

Unsafe version of vendorId.

nvendorIdback to summary
public static void nvendorId(long struct, short value)

Unsafe version of vendorId.

platformDataback to summary
public BGFXPlatformData platformData()

platform data

Annotations
@NativeType:bgfx_platform_data_t
platformDataback to summary
public BGFXInit platformData(BGFXPlatformData value)

Copies the specified BGFXPlatformData to the platformData field.

platformDataback to summary
public BGFXInit platformData(Consumer<BGFXPlatformData> consumer)

Passes the platformData field to the specified Consumer.

profileback to summary
public boolean profile()

enable device for profiling

Annotations
@NativeType:bool
profileback to summary
public BGFXInit profile(boolean value)

Sets the specified value to the profile field.

resolutionback to summary
public BGFXResolution resolution()

backbuffer resolution and reset parameters

Annotations
@NativeType:bgfx_resolution_t
resolutionback to summary
public BGFXInit resolution(BGFXResolution value)

Copies the specified BGFXResolution to the resolution field.

resolutionback to summary
public BGFXInit resolution(Consumer<BGFXResolution> consumer)

Passes the resolution field to the specified Consumer.

setback to summary
public BGFXInit set(int type, short vendorId, short deviceId, long capabilities, boolean debug, boolean profile, BGFXPlatformData platformData, BGFXResolution resolution, BGFXInitLimits limits, BGFXCallbackInterface callback, BGFXAllocatorInterface allocator)

Initializes this struct with the specified values.

setback to summary
public BGFXInit set(BGFXInit src)

Copies the specified struct data to this struct.

Parameters
src:BGFXInit

the source struct

Returns:BGFXInit

this struct

sizeofback to summary
public int sizeof()

Implements abstract org.lwjgl.system.Struct.sizeof.

Doc from org.lwjgl.system.Struct.sizeof.

Returns sizeof(struct).

Annotations
@Override
typeback to summary
public int type()

select rendering backend. When set to RENDERER_TYPE_COUNT a default rendering backend will be selected appropriate to the platform. One of:

RENDERER_TYPE_NOOPRENDERER_TYPE_AGCRENDERER_TYPE_DIRECT3D9RENDERER_TYPE_DIRECT3D11
RENDERER_TYPE_DIRECT3D12RENDERER_TYPE_GNMRENDERER_TYPE_METALRENDERER_TYPE_NVN
RENDERER_TYPE_OPENGLESRENDERER_TYPE_OPENGLRENDERER_TYPE_VULKANRENDERER_TYPE_COUNT
Annotations
@NativeType:bgfx_renderer_type_t
typeback to summary
public BGFXInit type(int value)

Sets the specified value to the type field.

validateback to summary
public static void validate(long struct)

Validates pointer members that should not be NULL.

Parameters
struct:long

the struct to validate

vendorIdback to summary
public short vendorId()

vendor PCI id. If set to PCI_ID_NONE it will select the first device. One of:

PCI_ID_NONEPCI_ID_SOFTWARE_RASTERIZERPCI_ID_AMDPCI_ID_APPLEPCI_ID_INTEL
PCI_ID_NVIDIAPCI_ID_MICROSOFTPCI_ID_ARM
Annotations
@NativeType:uint16_t
vendorIdback to summary
public BGFXInit vendorId(short value)

Sets the specified value to the vendorId field.