Class GLFWAllocator

    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • ALLOCATE, REALLOCATE, DEALLOCATE, USER

        The struct member offsets.
    • Constructor Detail

      • GLFWAllocator

        public GLFWAllocator​(java.nio.ByteBuffer container)
        Creates a GLFWAllocator 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

      • sizeof

        public int sizeof()
        Specified by:
        sizeof in class org.lwjgl.system.Struct
      • user

        public long user()
        a user-defined pointer that will be passed to the callbacks
      • user

        public GLFWAllocator user​(long value)
        Sets the specified value to the user() field.
      • set

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        public static long nuser​(long struct)
        Unsafe version of user().
      • nuser

        public static void nuser​(long struct,
                                 long value)
        Unsafe version of user.
      • validate

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