Class BGFXPlatformData

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class BGFXPlatformData extends Struct<BGFXPlatformData> implements NativeResource
Platform data.

Layout


 struct bgfx_platform_data_t {
     void * ndt();
     void * nwh();
     void * context();
     void * backBuffer();
     void * backBufferDS();
     bgfx_native_window_handle_type_t type();
 }
  • Field Details

    • SIZEOF

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

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

      public static final int NDT
      The struct member offsets.
    • NWH

      public static final int NWH
      The struct member offsets.
    • CONTEXT

      public static final int CONTEXT
      The struct member offsets.
    • BACKBUFFER

      public static final int BACKBUFFER
      The struct member offsets.
    • BACKBUFFERDS

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

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

    • BGFXPlatformData

      public BGFXPlatformData(ByteBuffer container)
      Creates a BGFXPlatformData 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<BGFXPlatformData>
    • ndt

      public long ndt()
      native display type (*nix specific)
    • nwh

      public long nwh()
      native window handle. If NULL, bgfx will create a headless context/device, provided the rendering API supports it.
    • context

      public long context()
      GL context, D3D device, or Vulkan device. If NULL, bgfx will create context/device.
    • backBuffer

      public long backBuffer()
      GL back-buffer, or D3D render target view. If NULL bgfx will create back-buffer color surface.
    • backBufferDS

      public long backBufferDS()
      backbuffer depth/stencil. If NULL, bgfx will create a back-buffer depth/stencil surface.
    • type

      public int type()
      handle type. Needed for platforms having more than one option.
    • ndt

      public BGFXPlatformData ndt(long value)
      Sets the specified value to the ndt() field.
    • nwh

      public BGFXPlatformData nwh(long value)
      Sets the specified value to the nwh() field.
    • context

      public BGFXPlatformData context(long value)
      Sets the specified value to the context() field.
    • backBuffer

      public BGFXPlatformData backBuffer(long value)
      Sets the specified value to the backBuffer() field.
    • backBufferDS

      public BGFXPlatformData backBufferDS(long value)
      Sets the specified value to the backBufferDS() field.
    • type

      public BGFXPlatformData type(int value)
      Sets the specified value to the type() field.
    • set

      public BGFXPlatformData set(long ndt, long nwh, long context, long backBuffer, long backBufferDS, int type)
      Initializes this struct with the specified values.
    • set

      Copies the specified struct data to this struct.
      Parameters:
      src - the source struct
      Returns:
      this struct
    • malloc

      public static BGFXPlatformData malloc()
      Returns a new BGFXPlatformData instance allocated with memAlloc. The instance must be explicitly freed.
    • calloc

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

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

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

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

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

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

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

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

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

      public static BGFXPlatformData calloc(MemoryStack stack)
      Returns a new BGFXPlatformData instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      stack - the stack from which to allocate
    • nndt

      public static long nndt(long struct)
      Unsafe version of ndt().
    • nnwh

      public static long nnwh(long struct)
      Unsafe version of nwh().
    • ncontext

      public static long ncontext(long struct)
      Unsafe version of context().
    • nbackBuffer

      public static long nbackBuffer(long struct)
      Unsafe version of backBuffer().
    • nbackBufferDS

      public static long nbackBufferDS(long struct)
      Unsafe version of backBufferDS().
    • ntype

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

      public static void nndt(long struct, long value)
      Unsafe version of ndt.
    • nnwh

      public static void nnwh(long struct, long value)
      Unsafe version of nwh.
    • ncontext

      public static void ncontext(long struct, long value)
      Unsafe version of context.
    • nbackBuffer

      public static void nbackBuffer(long struct, long value)
      Unsafe version of backBuffer.
    • nbackBufferDS

      public static void nbackBufferDS(long struct, long value)
      Unsafe version of backBufferDS.
    • ntype

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