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;
import org.lwjgl.vulkan.VkAllocationCallbacks;
public class VmaVirtualBlockCreateInfo extends Struct<VmaVirtualBlockCreateInfo> implements NativeResource {
public static final int SIZEOF;
public static final int ALIGNOF;
public static final int SIZE;
public static final int FLAGS;
public static final int PALLOCATIONCALLBACKS;
protected VmaVirtualBlockCreateInfo(long address, @Nullable ByteBuffer container) {
super(address, container);
}
protected VmaVirtualBlockCreateInfo create(long address, @Nullable ByteBuffer container) {
return new VmaVirtualBlockCreateInfo(address, container);
}
public VmaVirtualBlockCreateInfo(ByteBuffer container) {
super(MemoryUtil.memAddress(container), __checkContainer(container, SIZEOF));
}
public int sizeof() {
return SIZEOF;
}
@NativeType("VkDeviceSize")
public long size() {
return nsize(this.address());
}
@NativeType("VmaVirtualBlockCreateFlagBits")
public int flags() {
return nflags(this.address());
}
@Nullable
@NativeType("VkAllocationCallbacks const *")
public VkAllocationCallbacks pAllocationCallbacks() {
return npAllocationCallbacks(this.address());
}
public VmaVirtualBlockCreateInfo size(@NativeType("VkDeviceSize") long value) {
nsize(this.address(), value);
return this;
}
public VmaVirtualBlockCreateInfo flags(@NativeType("VmaVirtualBlockCreateFlagBits") int value) {
nflags(this.address(), value);
return this;
}
public VmaVirtualBlockCreateInfo pAllocationCallbacks(@Nullable @NativeType("VkAllocationCallbacks const *") VkAllocationCallbacks value) {
npAllocationCallbacks(this.address(), value);
return this;
}
public VmaVirtualBlockCreateInfo set(long size, int flags, @Nullable VkAllocationCallbacks pAllocationCallbacks) {
this.size(size);
this.flags(flags);
this.pAllocationCallbacks(pAllocationCallbacks);
return this;
}
public VmaVirtualBlockCreateInfo set(VmaVirtualBlockCreateInfo src) {
MemoryUtil.memCopy(src.address(), this.address(), (long)SIZEOF);
return this;
}
public static VmaVirtualBlockCreateInfo malloc() {
return new VmaVirtualBlockCreateInfo(MemoryUtil.nmemAllocChecked((long)SIZEOF), (ByteBuffer)null);
}
public static VmaVirtualBlockCreateInfo calloc() {
return new VmaVirtualBlockCreateInfo(MemoryUtil.nmemCallocChecked(1L, (long)SIZEOF), (ByteBuffer)null);
}
public static VmaVirtualBlockCreateInfo create() {
ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF);
return new VmaVirtualBlockCreateInfo(MemoryUtil.memAddress(container), container);
}
public static VmaVirtualBlockCreateInfo create(long address) {
return new VmaVirtualBlockCreateInfo(address, (ByteBuffer)null);
}
@Nullable
public static VmaVirtualBlockCreateInfo createSafe(long address) {
return address == 0L ? null : new VmaVirtualBlockCreateInfo(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);
}
public static VmaVirtualBlockCreateInfo malloc(MemoryStack stack) {
return new VmaVirtualBlockCreateInfo(stack.nmalloc(ALIGNOF, SIZEOF), (ByteBuffer)null);
}
public static VmaVirtualBlockCreateInfo calloc(MemoryStack stack) {
return new VmaVirtualBlockCreateInfo(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 long nsize(long struct) {
return UNSAFE.getLong((Object)null, struct + (long)SIZE);
}
public static int nflags(long struct) {
return UNSAFE.getInt((Object)null, struct + (long)FLAGS);
}
@Nullable
public static VkAllocationCallbacks npAllocationCallbacks(long struct) {
return VkAllocationCallbacks.createSafe(MemoryUtil.memGetAddress(struct + (long)PALLOCATIONCALLBACKS));
}
public static void nsize(long struct, long value) {
UNSAFE.putLong((Object)null, struct + (long)SIZE, value);
}
public static void nflags(long struct, int value) {
UNSAFE.putInt((Object)null, struct + (long)FLAGS, value);
}
public static void npAllocationCallbacks(long struct, @Nullable VkAllocationCallbacks value) {
MemoryUtil.memPutAddress(struct + (long)PALLOCATIONCALLBACKS, MemoryUtil.memAddressSafe(value));
}
static {
Struct.Layout layout = __struct(new Struct.Member[]{__member(8), __member(4), __member(POINTER_SIZE)});
SIZEOF = layout.getSize();
ALIGNOF = layout.getAlignment();
SIZE = layout.offsetof(0);
FLAGS = layout.offsetof(1);
PALLOCATIONCALLBACKS = layout.offsetof(2);
}
public static class Buffer extends StructBuffer<VmaVirtualBlockCreateInfo, Buffer> implements NativeResource {
private static final VmaVirtualBlockCreateInfo ELEMENT_FACTORY = VmaVirtualBlockCreateInfo.create(-1L);
public Buffer(ByteBuffer container) {
super(container, container.remaining() / VmaVirtualBlockCreateInfo.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 VmaVirtualBlockCreateInfo getElementFactory() {
return ELEMENT_FACTORY;
}
@NativeType("VkDeviceSize")
public long size() {
return VmaVirtualBlockCreateInfo.nsize(this.address());
}
@NativeType("VmaVirtualBlockCreateFlagBits")
public int flags() {
return VmaVirtualBlockCreateInfo.nflags(this.address());
}
@Nullable
@NativeType("VkAllocationCallbacks const *")
public VkAllocationCallbacks pAllocationCallbacks() {
return VmaVirtualBlockCreateInfo.npAllocationCallbacks(this.address());
}
public Buffer size(@NativeType("VkDeviceSize") long value) {
VmaVirtualBlockCreateInfo.nsize(this.address(), value);
return this;
}
public Buffer flags(@NativeType("VmaVirtualBlockCreateFlagBits") int value) {
VmaVirtualBlockCreateInfo.nflags(this.address(), value);
return this;
}
public Buffer pAllocationCallbacks(@Nullable @NativeType("VkAllocationCallbacks const *") VkAllocationCallbacks value) {
VmaVirtualBlockCreateInfo.npAllocationCallbacks(this.address(), value);
return this;
}
}
}
Download file