Class BGFXMemory

java.lang.Object
org.lwjgl.system.Pointer.Default
org.lwjgl.system.Struct<BGFXMemory>
org.lwjgl.bgfx.BGFXMemory
All Implemented Interfaces:
AutoCloseable, org.lwjgl.system.NativeResource, org.lwjgl.system.Pointer

public class BGFXMemory extends org.lwjgl.system.Struct<BGFXMemory> implements org.lwjgl.system.NativeResource
Memory must be obtained by calling alloc, copy, or make_ref.

It is illegal to create this structure on stack and pass it to any bgfx API.

Layout


 struct bgfx_memory_t {
     uint8_t * data();
     uint32_t size();
 }
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    An array of BGFXMemory structs.

    Nested classes/interfaces inherited from class org.lwjgl.system.Struct

    org.lwjgl.system.Struct.StructValidation

    Nested classes/interfaces inherited from interface org.lwjgl.system.Pointer

    org.lwjgl.system.Pointer.Default
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    The struct alignment in bytes.
    static final int
    The struct member offsets.
    static final int
    The struct member offsets.
    static final int
    The struct size in bytes.

    Fields inherited from interface org.lwjgl.system.Pointer

    BITS32, BITS64, CLONG_SHIFT, CLONG_SIZE, POINTER_SHIFT, POINTER_SIZE
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a BGFXMemory instance at the current position of the specified ByteBuffer container.
  • Method Summary

    Modifier and Type
    Method
    Description
    static BGFXMemory
    Returns a new BGFXMemory instance allocated with memCalloc.
    calloc(int capacity)
    Returns a new BGFXMemory.Buffer instance allocated with memCalloc.
    calloc(int capacity, org.lwjgl.system.MemoryStack stack)
    Returns a new BGFXMemory.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
    static BGFXMemory
    calloc(org.lwjgl.system.MemoryStack stack)
    Returns a new BGFXMemory instance allocated on the specified MemoryStack and initializes all its bits to zero.
    static BGFXMemory
    Deprecated.
    callocStack(int capacity)
    Deprecated.
    callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
    Deprecated.
    static BGFXMemory
    callocStack(org.lwjgl.system.MemoryStack stack)
    Deprecated.
    static BGFXMemory
    Returns a new BGFXMemory instance allocated with BufferUtils.
    create(int capacity)
    Returns a new BGFXMemory.Buffer instance allocated with BufferUtils.
    static BGFXMemory
    create(long address)
    Returns a new BGFXMemory instance for the specified memory address.
    create(long address, int capacity)
    Create a BGFXMemory.Buffer instance at the specified memory.
    static @Nullable BGFXMemory
    createSafe(long address)
    Like create, but returns null if address is NULL.
    static @Nullable BGFXMemory.Buffer
    createSafe(long address, int capacity)
    Like create, but returns null if address is NULL.
    pointer to data
    Sets the address of the specified ByteBuffer to the data() field.
    static BGFXMemory
    Returns a new BGFXMemory instance allocated with memAlloc.
    malloc(int capacity)
    Returns a new BGFXMemory.Buffer instance allocated with memAlloc.
    malloc(int capacity, org.lwjgl.system.MemoryStack stack)
    Returns a new BGFXMemory.Buffer instance allocated on the specified MemoryStack.
    static BGFXMemory
    malloc(org.lwjgl.system.MemoryStack stack)
    Returns a new BGFXMemory instance allocated on the specified MemoryStack.
    static BGFXMemory
    Deprecated.
    mallocStack(int capacity)
    Deprecated.
    mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
    Deprecated.
    static BGFXMemory
    mallocStack(org.lwjgl.system.MemoryStack stack)
    Deprecated.
    static ByteBuffer
    ndata(long struct)
    Unsafe version of data.
    static void
    ndata(long struct, ByteBuffer value)
    Unsafe version of data.
    static int
    nsize(long struct)
    Unsafe version of size().
    static void
    nsize(long struct, int value)
    Sets the specified value to the size field of the specified struct.
    Copies the specified struct data to this struct.
    int
    data size
    int
     
    static void
    validate(long struct)
    Validates pointer members that should not be NULL.

    Methods inherited from class org.lwjgl.system.Struct

    clear, free, isNull, validate, validate

    Methods inherited from class org.lwjgl.system.Pointer.Default

    address, equals, hashCode, toString

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.lwjgl.system.NativeResource

    close, free
  • Field Details

    • SIZEOF

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

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

      public static final int DATA
      The struct member offsets.
    • SIZE

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

    • BGFXMemory

      public BGFXMemory(ByteBuffer container)
      Creates a BGFXMemory 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()
      Specified by:
      sizeof in class org.lwjgl.system.Struct<BGFXMemory>
    • data

      public ByteBuffer data()
      pointer to data
    • size

      public int size()
      data size
    • data

      public BGFXMemory data(ByteBuffer value)
      Sets the address of the specified ByteBuffer to the data() field.
    • set

      public BGFXMemory set(BGFXMemory src)
      Copies the specified struct data to this struct.
      Parameters:
      src - the source struct
      Returns:
      this struct
    • malloc

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

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

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

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

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

      public static BGFXMemory.Buffer malloc(int capacity)
      Returns a new BGFXMemory.Buffer instance allocated with memAlloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • calloc

      public static BGFXMemory.Buffer calloc(int capacity)
      Returns a new BGFXMemory.Buffer instance allocated with memCalloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • create

      public static BGFXMemory.Buffer create(int capacity)
      Returns a new BGFXMemory.Buffer instance allocated with BufferUtils.
      Parameters:
      capacity - the buffer capacity
    • create

      public static BGFXMemory.Buffer create(long address, int capacity)
      Create a BGFXMemory.Buffer instance at the specified memory.
      Parameters:
      address - the memory address
      capacity - the buffer capacity
    • createSafe

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

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

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

      @Deprecated public static BGFXMemory mallocStack(org.lwjgl.system.MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.
    • callocStack

      @Deprecated public static BGFXMemory callocStack(org.lwjgl.system.MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.
    • mallocStack

      @Deprecated public static BGFXMemory.Buffer mallocStack(int capacity)
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(int, MemoryStack) instead.
    • callocStack

      @Deprecated public static BGFXMemory.Buffer callocStack(int capacity)
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(int, MemoryStack) instead.
    • mallocStack

      @Deprecated public static BGFXMemory.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(int, MemoryStack) instead.
    • callocStack

      @Deprecated public static BGFXMemory.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(int, MemoryStack) instead.
    • malloc

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

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

      public static BGFXMemory.Buffer malloc(int capacity, org.lwjgl.system.MemoryStack stack)
      Returns a new BGFXMemory.Buffer instance allocated on the specified MemoryStack.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • calloc

      public static BGFXMemory.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack)
      Returns a new BGFXMemory.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • ndata

      public static ByteBuffer ndata(long struct)
      Unsafe version of data.
    • nsize

      public static int nsize(long struct)
      Unsafe version of size().
    • ndata

      public static void ndata(long struct, ByteBuffer value)
      Unsafe version of data.
    • nsize

      public static void nsize(long struct, int value)
      Sets the specified value to the size field of the specified struct.
    • validate

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