Class BGFXInit

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

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;
     {@link BGFXPlatformData bgfx_platform_data_t} platformData;
     {@link BGFXResolution bgfx_resolution_t} resolution;
     {@link BGFXInitLimits bgfx_init_limits_t} limits;
     {@link BGFXCallbackInterface bgfx_callback_interface_t} * callback;
     {@link BGFXAllocatorInterface 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

      public int type()
      Returns:
      the value of the type field.
    • vendorId

      public short vendorId()
      Returns:
      the value of the vendorId field.
    • deviceId

      public short deviceId()
      Returns:
      the value of the deviceId field.
    • capabilities

      public long capabilities()
      Returns:
      the value of the capabilities field.
    • debug

      public boolean debug()
      Returns:
      the value of the debug field.
    • profile

      public boolean profile()
      Returns:
      the value of the profile field.
    • platformData

      public BGFXPlatformData platformData()
      Returns:
      a BGFXPlatformData view of the platformData field.
    • resolution

      public BGFXResolution resolution()
      Returns:
      a BGFXResolution view of the resolution field.
    • limits

      public BGFXInitLimits limits()
      Returns:
      a BGFXInitLimits view of the limits field.
    • callback

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

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

      public BGFXInit type(int value)
      Sets the specified value to the type field.
    • vendorId

      public BGFXInit vendorId(short value)
      Sets the specified value to the vendorId field.
    • deviceId

      public BGFXInit deviceId(short value)
      Sets the specified value to the deviceId field.
    • capabilities

      public BGFXInit capabilities(long value)
      Sets the specified value to the capabilities field.
    • debug

      public BGFXInit debug(boolean value)
      Sets the specified value to the debug field.
    • profile

      public BGFXInit profile(boolean value)
      Sets the specified value to the profile field.
    • platformData

      public BGFXInit platformData(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(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(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(@Nullable BGFXCallbackInterface value)
      Sets the address of the specified BGFXCallbackInterface to the callback field.
    • allocator

      public BGFXInit allocator(@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.
    • mallocStack

      @Deprecated public static BGFXInit mallocStack()
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.
    • callocStack

      @Deprecated public static BGFXInit callocStack()
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.
    • mallocStack

      @Deprecated public static BGFXInit mallocStack(MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.
    • callocStack

      @Deprecated public static BGFXInit callocStack(MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.
    • 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