Class BGFXInit

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

@NativeType("struct bgfx_init_t") public class BGFXInit extends Struct<BGFXInit> implements NativeResource
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 Details

    • SIZEOF

      public static final int SIZEOF
      The struct size in bytes.
    • ALIGNOF

      public static final int ALIGNOF
      The struct alignment in bytes.
    • TYPE

      public static final int TYPE
      The struct member offsets.
    • VENDORID

      public static final int VENDORID
      The struct member offsets.
    • DEVICEID

      public static final int DEVICEID
      The struct member offsets.
    • CAPABILITIES

      public static final int CAPABILITIES
      The struct member offsets.
    • DEBUG

      public static final int DEBUG
      The struct member offsets.
    • PROFILE

      public static final int PROFILE
      The struct member offsets.
    • PLATFORMDATA

      public static final int PLATFORMDATA
      The struct member offsets.
    • RESOLUTION

      public static final int RESOLUTION
      The struct member offsets.
    • LIMITS

      public static final int LIMITS
      The struct member offsets.
    • CALLBACK

      public static final int CALLBACK
      The struct member offsets.
    • ALLOCATOR

      public static final int ALLOCATOR
      The struct member offsets.
  • Constructor Details

    • BGFXInit

      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 Details

    • sizeof

      public int sizeof()
      Description copied from class: Struct
      Returns sizeof(struct).
      Specified by:
      sizeof in class Struct<BGFXInit>
    • type

      @NativeType("bgfx_renderer_type_t") public int type()
      Returns:
      the value of the type field.
    • vendorId

      @NativeType("uint16_t") public short vendorId()
      Returns:
      the value of the vendorId field.
    • deviceId

      @NativeType("uint16_t") public short deviceId()
      Returns:
      the value of the deviceId field.
    • capabilities

      @NativeType("uint64_t") public long capabilities()
      Returns:
      the value of the capabilities field.
    • debug

      @NativeType("bool") public boolean debug()
      Returns:
      the value of the debug field.
    • profile

      @NativeType("bool") public boolean profile()
      Returns:
      the value of the profile field.
    • platformData

      @NativeType("bgfx_platform_data_t") public BGFXPlatformData platformData()
      Returns:
      a BGFXPlatformData view of the platformData field.
    • resolution

      @NativeType("bgfx_resolution_t") public BGFXResolution resolution()
      Returns:
      a BGFXResolution view of the resolution field.
    • limits

      @NativeType("bgfx_init_limits_t") public BGFXInitLimits limits()
      Returns:
      a BGFXInitLimits view of the limits field.
    • callback

      @NativeType("bgfx_callback_interface_t *") public @Nullable BGFXCallbackInterface callback()
      Returns:
      a BGFXCallbackInterface view of the struct pointed to by the callback field.
    • allocator

      @NativeType("bgfx_allocator_interface_t *") public @Nullable BGFXAllocatorInterface allocator()
      Returns:
      a BGFXAllocatorInterface view of the struct pointed to by the allocator field.
    • type

      public BGFXInit type(@NativeType("bgfx_renderer_type_t") int value)
      Sets the specified value to the type field.
    • vendorId

      public BGFXInit vendorId(@NativeType("uint16_t") short value)
      Sets the specified value to the vendorId field.
    • deviceId

      public BGFXInit deviceId(@NativeType("uint16_t") short value)
      Sets the specified value to the deviceId field.
    • capabilities

      public BGFXInit capabilities(@NativeType("uint64_t") long value)
      Sets the specified value to the capabilities field.
    • debug

      public BGFXInit debug(@NativeType("bool") boolean value)
      Sets the specified value to the debug field.
    • profile

      public BGFXInit profile(@NativeType("bool") boolean value)
      Sets the specified value to the profile field.
    • platformData

      public BGFXInit platformData(@NativeType("bgfx_platform_data_t") BGFXPlatformData value)
      Copies the specified BGFXPlatformData to the platformData field.
    • platformData

      public BGFXInit platformData(Consumer<BGFXPlatformData> consumer)
      Passes the platformData field to the specified Consumer.
    • resolution

      public BGFXInit resolution(@NativeType("bgfx_resolution_t") BGFXResolution value)
      Copies the specified BGFXResolution to the resolution field.
    • resolution

      public BGFXInit resolution(Consumer<BGFXResolution> consumer)
      Passes the resolution field to the specified Consumer.
    • limits

      public BGFXInit limits(@NativeType("bgfx_init_limits_t") BGFXInitLimits value)
      Copies the specified BGFXInitLimits to the limits field.
    • limits

      public BGFXInit limits(Consumer<BGFXInitLimits> consumer)
      Passes the limits field to the specified Consumer.
    • callback

      public BGFXInit callback(@NativeType("bgfx_callback_interface_t *") @Nullable BGFXCallbackInterface value)
      Sets the address of the specified BGFXCallbackInterface to the callback field.
    • allocator

      public BGFXInit allocator(@NativeType("bgfx_allocator_interface_t *") @Nullable BGFXAllocatorInterface value)
      Sets the address of the specified BGFXAllocatorInterface to the allocator field.
    • set

      public BGFXInit set(int type, short vendorId, short deviceId, long capabilities, 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 new BGFXInit instance allocated with memAlloc. The instance must be explicitly freed.
    • calloc

      public static BGFXInit calloc()
      Returns a new BGFXInit instance allocated with memCalloc. The instance must be explicitly freed.
    • create

      public static BGFXInit create()
      Returns a new BGFXInit instance allocated with BufferUtils.
    • create

      public static BGFXInit create(long address)
      Returns a new BGFXInit instance for the specified memory address.
    • createSafe

      public static @Nullable BGFXInit createSafe(long address)
      Like create, but returns null if address is NULL.
    • malloc

      public static BGFXInit malloc(MemoryStack stack)
      Returns a new BGFXInit instance allocated on the specified MemoryStack.
      Parameters:
      stack - the stack from which to allocate
    • calloc

      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 - the stack from which to allocate
    • ntype

      public static int ntype(long struct)
      Unsafe version of type().
    • nvendorId

      public static short nvendorId(long struct)
      Unsafe version of vendorId().
    • ndeviceId

      public static short ndeviceId(long struct)
      Unsafe version of deviceId().
    • ncapabilities

      public static long ncapabilities(long struct)
      Unsafe version of capabilities().
    • ndebug

      public static boolean ndebug(long struct)
      Unsafe version of debug().
    • nprofile

      public static boolean nprofile(long struct)
      Unsafe version of profile().
    • nplatformData

      public static BGFXPlatformData nplatformData(long struct)
      Unsafe version of platformData().
    • nresolution

      public static BGFXResolution nresolution(long struct)
      Unsafe version of resolution().
    • nlimits

      public static BGFXInitLimits nlimits(long struct)
      Unsafe version of limits().
    • ncallback

      public static @Nullable BGFXCallbackInterface ncallback(long struct)
      Unsafe version of callback().
    • nallocator

      public static @Nullable BGFXAllocatorInterface nallocator(long struct)
      Unsafe version of allocator().
    • ntype

      public static void ntype(long struct, int value)
      Unsafe version of type.
    • nvendorId

      public static void nvendorId(long struct, short value)
      Unsafe version of vendorId.
    • ndeviceId

      public static void ndeviceId(long struct, short value)
      Unsafe version of deviceId.
    • ncapabilities

      public static void ncapabilities(long struct, long value)
      Unsafe version of capabilities.
    • ndebug

      public static void ndebug(long struct, boolean value)
      Unsafe version of debug.
    • nprofile

      public static void nprofile(long struct, boolean value)
      Unsafe version of profile.
    • nplatformData

      public static void nplatformData(long struct, BGFXPlatformData value)
      Unsafe version of platformData.
    • nresolution

      public static void nresolution(long struct, BGFXResolution value)
      Unsafe version of resolution.
    • nlimits

      public static void nlimits(long struct, BGFXInitLimits value)
      Unsafe version of limits.
    • ncallback

      public static void ncallback(long struct, @Nullable BGFXCallbackInterface value)
      Unsafe version of callback.
    • nallocator

      public static void nallocator(long struct, @Nullable BGFXAllocatorInterface value)
      Unsafe version of allocator.
    • validate

      public static void validate(long struct)
      Validates pointer members that should not be NULL.
      Parameters:
      struct - the struct to validate