lwjgl-vma-3.3.3.jar
Download file
package org.lwjgl.util.vma;
import java.nio.ByteBuffer;
import javax.annotation.Nullable;
import org.lwjgl.BufferUtils;
import org.lwjgl.system.MemoryStack;
import org.lwjgl.system.MemoryUtil;
import org.lwjgl.system.NativeResource;
import org.lwjgl.system.NativeType;
import org.lwjgl.system.Struct;
import org.lwjgl.system.StructBuffer;
public class VmaAllocationCreateInfo extends Struct<VmaAllocationCreateInfo> implements NativeResource {
public static final int SIZEOF;
public static final int ALIGNOF;
public static final int FLAGS;
public static final int USAGE;
public static final int REQUIREDFLAGS;
public static final int PREFERREDFLAGS;
public static final int MEMORYTYPEBITS;
public static final int POOL;
public static final int PUSERDATA;
public static final int PRIORITY;
protected VmaAllocationCreateInfo(long address, @Nullable ByteBuffer container) {
super(address, container);
}
protected VmaAllocationCreateInfo create(long address, @Nullable ByteBuffer container) {
return new VmaAllocationCreateInfo(address, container);
}
public VmaAllocationCreateInfo(ByteBuffer container) {
super(MemoryUtil.memAddress(container), __checkContainer(container, SIZEOF));
}
public int sizeof() {
return SIZEOF;
}
@NativeType("VmaAllocationCreateFlags")
public int flags() {
return nflags(this.address());
}
@NativeType("VmaMemoryUsage")
public int usage() {
return nusage(this.address());
}
@NativeType("VkMemoryPropertyFlags")
public int requiredFlags() {
return nrequiredFlags(this.address());
}
@NativeType("VkMemoryPropertyFlags")
public int preferredFlags() {
return npreferredFlags(this.address());
}
@NativeType("uint32_t")
public int memoryTypeBits() {
return nmemoryTypeBits(this.address());
}
@NativeType("VmaPool")
public long pool() {
return npool(this.address());
}
@NativeType("void *")
public long pUserData() {
return npUserData(this.address());
}
public float priority() {
return npriority(this.address());
}
public VmaAllocationCreateInfo flags(@NativeType("VmaAllocationCreateFlags") int value) {
nflags(this.address(), value);
return this;
}
public VmaAllocationCreateInfo usage(@NativeType("VmaMemoryUsage") int value) {
nusage(this.address(), value);
return this;
}
public VmaAllocationCreateInfo requiredFlags(@NativeType("VkMemoryPropertyFlags") int value) {
nrequiredFlags(this.address(), value);
return this;
}
public VmaAllocationCreateInfo preferredFlags(@NativeType("VkMemoryPropertyFlags") int value) {
npreferredFlags(this.address(), value);
return this;
}
public VmaAllocationCreateInfo memoryTypeBits(@NativeType("uint32_t") int value) {
nmemoryTypeBits(this.address(), value);
return this;
}
public VmaAllocationCreateInfo pool(@NativeType("VmaPool") long value) {
npool(this.address(), value);
return this;
}
public VmaAllocationCreateInfo pUserData(@NativeType("void *") long value) {
npUserData(this.address(), value);
return this;
}
public VmaAllocationCreateInfo priority(float value) {
npriority(this.address(), value);
return this;
}
public VmaAllocationCreateInfo set(int flags, int usage, int requiredFlags, int preferredFlags, int memoryTypeBits, long pool, long pUserData, float priority) {
this.flags(flags);
this.usage(usage);
this.requiredFlags(requiredFlags);
this.preferredFlags(preferredFlags);
this.memoryTypeBits(memoryTypeBits);
this.pool(pool);
this.pUserData(pUserData);
this.priority(priority);
return this;
}
public VmaAllocationCreateInfo set(VmaAllocationCreateInfo src) {
MemoryUtil.memCopy(src.address(), this.address(), (long)SIZEOF);
return this;
}
public static VmaAllocationCreateInfo malloc() {
return new VmaAllocationCreateInfo(MemoryUtil.nmemAllocChecked((long)SIZEOF), (ByteBuffer)null);
}
public static VmaAllocationCreateInfo calloc() {
return new VmaAllocationCreateInfo(MemoryUtil.nmemCallocChecked(1L, (long)SIZEOF), (ByteBuffer)null);
}
public static VmaAllocationCreateInfo create() {
ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF);
return new VmaAllocationCreateInfo(MemoryUtil.memAddress(container), container);
}
public static VmaAllocationCreateInfo create(long address) {
return new VmaAllocationCreateInfo(address, (ByteBuffer)null);
}
@Nullable
public static VmaAllocationCreateInfo createSafe(long address) {
return address == 0L ? null : new VmaAllocationCreateInfo(address, (ByteBuffer)null);
}
public static Buffer malloc(int capacity) {
return new Buffer(MemoryUtil.nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity);
}
public static Buffer calloc(int capacity) {
return new Buffer(MemoryUtil.nmemCallocChecked((long)capacity, (long)SIZEOF), capacity);
}
public static Buffer create(int capacity) {
ByteBuffer container = __create(capacity, SIZEOF);
return new Buffer(MemoryUtil.memAddress(container), container, -1, 0, capacity, capacity);
}
public static Buffer create(long address, int capacity) {
return new Buffer(address, capacity);
}
@Nullable
public static Buffer createSafe(long address, int capacity) {
return address == 0L ? null : new Buffer(address, capacity);
}
/** @deprecated */
@Deprecated
public static VmaAllocationCreateInfo mallocStack() {
return malloc(MemoryStack.stackGet());
}
/** @deprecated */
@Deprecated
public static VmaAllocationCreateInfo callocStack() {
return calloc(MemoryStack.stackGet());
}
/** @deprecated */
@Deprecated
public static VmaAllocationCreateInfo mallocStack(MemoryStack stack) {
return malloc(stack);
}
/** @deprecated */
@Deprecated
public static VmaAllocationCreateInfo callocStack(MemoryStack stack) {
return calloc(stack);
}
/** @deprecated */
@Deprecated
public static Buffer mallocStack(int capacity) {
return malloc(capacity, MemoryStack.stackGet());
}
/** @deprecated */
@Deprecated
public static Buffer callocStack(int capacity) {
return calloc(capacity, MemoryStack.stackGet());
}
/** @deprecated */
@Deprecated
public static Buffer mallocStack(int capacity, MemoryStack stack) {
return malloc(capacity, stack);
}
/** @deprecated */
@Deprecated
public static Buffer callocStack(int capacity, MemoryStack stack) {
return calloc(capacity, stack);
}
public static VmaAllocationCreateInfo malloc(MemoryStack stack) {
return new VmaAllocationCreateInfo(stack.nmalloc(ALIGNOF, SIZEOF), (ByteBuffer)null);
}
public static VmaAllocationCreateInfo calloc(MemoryStack stack) {
return new VmaAllocationCreateInfo(stack.ncalloc(ALIGNOF, 1, SIZEOF), (ByteBuffer)null);
}
public static Buffer malloc(int capacity, MemoryStack stack) {
return new Buffer(stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity);
}
public static Buffer calloc(int capacity, MemoryStack stack) {
return new Buffer(stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity);
}
public static int nflags(long struct) {
return UNSAFE.getInt((Object)null, struct + (long)FLAGS);
}
public static int nusage(long struct) {
return UNSAFE.getInt((Object)null, struct + (long)USAGE);
}
public static int nrequiredFlags(long struct) {
return UNSAFE.getInt((Object)null, struct + (long)REQUIREDFLAGS);
}
public static int npreferredFlags(long struct) {
return UNSAFE.getInt((Object)null, struct + (long)PREFERREDFLAGS);
}
public static int nmemoryTypeBits(long struct) {
return UNSAFE.getInt((Object)null, struct + (long)MEMORYTYPEBITS);
}
public static long npool(long struct) {
return MemoryUtil.memGetAddress(struct + (long)POOL);
}
public static long npUserData(long struct) {
return MemoryUtil.memGetAddress(struct + (long)PUSERDATA);
}
public static float npriority(long struct) {
return UNSAFE.getFloat((Object)null, struct + (long)PRIORITY);
}
public static void nflags(long struct, int value) {
UNSAFE.putInt((Object)null, struct + (long)FLAGS, value);
}
public static void nusage(long struct, int value) {
UNSAFE.putInt((Object)null, struct + (long)USAGE, value);
}
public static void nrequiredFlags(long struct, int value) {
UNSAFE.putInt((Object)null, struct + (long)REQUIREDFLAGS, value);
}
public static void npreferredFlags(long struct, int value) {
UNSAFE.putInt((Object)null, struct + (long)PREFERREDFLAGS, value);
}
public static void nmemoryTypeBits(long struct, int value) {
UNSAFE.putInt((Object)null, struct + (long)MEMORYTYPEBITS, value);
}
public static void npool(long struct, long value) {
MemoryUtil.memPutAddress(struct + (long)POOL, value);
}
public static void npUserData(long struct, long value) {
MemoryUtil.memPutAddress(struct + (long)PUSERDATA, value);
}
public static void npriority(long struct, float value) {
UNSAFE.putFloat((Object)null, struct + (long)PRIORITY, value);
}
static {
Struct.Layout layout = __struct(new Struct.Member[]{__member(4), __member(4), __member(4), __member(4), __member(4), __member(POINTER_SIZE), __member(POINTER_SIZE), __member(4)});
SIZEOF = layout.getSize();
ALIGNOF = layout.getAlignment();
FLAGS = layout.offsetof(0);
USAGE = layout.offsetof(1);
REQUIREDFLAGS = layout.offsetof(2);
PREFERREDFLAGS = layout.offsetof(3);
MEMORYTYPEBITS = layout.offsetof(4);
POOL = layout.offsetof(5);
PUSERDATA = layout.offsetof(6);
PRIORITY = layout.offsetof(7);
}
public static class Buffer extends StructBuffer<VmaAllocationCreateInfo, Buffer> implements NativeResource {
private static final VmaAllocationCreateInfo ELEMENT_FACTORY = VmaAllocationCreateInfo.create(-1L);
public Buffer(ByteBuffer container) {
super(container, container.remaining() / VmaAllocationCreateInfo.SIZEOF);
}
public Buffer(long address, int cap) {
super(address, (ByteBuffer)null, -1, 0, cap, cap);
}
Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) {
super(address, container, mark, pos, lim, cap);
}
protected Buffer self() {
return this;
}
protected VmaAllocationCreateInfo getElementFactory() {
return ELEMENT_FACTORY;
}
@NativeType("VmaAllocationCreateFlags")
public int flags() {
return VmaAllocationCreateInfo.nflags(this.address());
}
@NativeType("VmaMemoryUsage")
public int usage() {
return VmaAllocationCreateInfo.nusage(this.address());
}
@NativeType("VkMemoryPropertyFlags")
public int requiredFlags() {
return VmaAllocationCreateInfo.nrequiredFlags(this.address());
}
@NativeType("VkMemoryPropertyFlags")
public int preferredFlags() {
return VmaAllocationCreateInfo.npreferredFlags(this.address());
}
@NativeType("uint32_t")
public int memoryTypeBits() {
return VmaAllocationCreateInfo.nmemoryTypeBits(this.address());
}
@NativeType("VmaPool")
public long pool() {
return VmaAllocationCreateInfo.npool(this.address());
}
@NativeType("void *")
public long pUserData() {
return VmaAllocationCreateInfo.npUserData(this.address());
}
public float priority() {
return VmaAllocationCreateInfo.npriority(this.address());
}
public Buffer flags(@NativeType("VmaAllocationCreateFlags") int value) {
VmaAllocationCreateInfo.nflags(this.address(), value);
return this;
}
public Buffer usage(@NativeType("VmaMemoryUsage") int value) {
VmaAllocationCreateInfo.nusage(this.address(), value);
return this;
}
public Buffer requiredFlags(@NativeType("VkMemoryPropertyFlags") int value) {
VmaAllocationCreateInfo.nrequiredFlags(this.address(), value);
return this;
}
public Buffer preferredFlags(@NativeType("VkMemoryPropertyFlags") int value) {
VmaAllocationCreateInfo.npreferredFlags(this.address(), value);
return this;
}
public Buffer memoryTypeBits(@NativeType("uint32_t") int value) {
VmaAllocationCreateInfo.nmemoryTypeBits(this.address(), value);
return this;
}
public Buffer pool(@NativeType("VmaPool") long value) {
VmaAllocationCreateInfo.npool(this.address(), value);
return this;
}
public Buffer pUserData(@NativeType("void *") long value) {
VmaAllocationCreateInfo.npUserData(this.address(), value);
return this;
}
public Buffer priority(float value) {
VmaAllocationCreateInfo.npriority(this.address(), value);
return this;
}
}
}
Download file