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.Checks;
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 VmaDefragmentationMove extends Struct<VmaDefragmentationMove> implements NativeResource {
public static final int SIZEOF;
public static final int ALIGNOF;
public static final int OPERATION;
public static final int SRCALLOCATION;
public static final int DSTTMPALLOCATION;
protected VmaDefragmentationMove(long address, @Nullable ByteBuffer container) {
super(address, container);
}
protected VmaDefragmentationMove create(long address, @Nullable ByteBuffer container) {
return new VmaDefragmentationMove(address, container);
}
public VmaDefragmentationMove(ByteBuffer container) {
super(MemoryUtil.memAddress(container), __checkContainer(container, SIZEOF));
}
public int sizeof() {
return SIZEOF;
}
@NativeType("VmaDefragmentationMoveOperation")
public int operation() {
return noperation(this.address());
}
@NativeType("VmaAllocation")
public long srcAllocation() {
return nsrcAllocation(this.address());
}
@NativeType("VmaAllocation")
public long dstTmpAllocation() {
return ndstTmpAllocation(this.address());
}
public VmaDefragmentationMove operation(@NativeType("VmaDefragmentationMoveOperation") int value) {
noperation(this.address(), value);
return this;
}
public VmaDefragmentationMove srcAllocation(@NativeType("VmaAllocation") long value) {
nsrcAllocation(this.address(), value);
return this;
}
public VmaDefragmentationMove dstTmpAllocation(@NativeType("VmaAllocation") long value) {
ndstTmpAllocation(this.address(), value);
return this;
}
public VmaDefragmentationMove set(int operation, long srcAllocation, long dstTmpAllocation) {
this.operation(operation);
this.srcAllocation(srcAllocation);
this.dstTmpAllocation(dstTmpAllocation);
return this;
}
public VmaDefragmentationMove set(VmaDefragmentationMove src) {
MemoryUtil.memCopy(src.address(), this.address(), (long)SIZEOF);
return this;
}
public static VmaDefragmentationMove malloc() {
return new VmaDefragmentationMove(MemoryUtil.nmemAllocChecked((long)SIZEOF), (ByteBuffer)null);
}
public static VmaDefragmentationMove calloc() {
return new VmaDefragmentationMove(MemoryUtil.nmemCallocChecked(1L, (long)SIZEOF), (ByteBuffer)null);
}
public static VmaDefragmentationMove create() {
ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF);
return new VmaDefragmentationMove(MemoryUtil.memAddress(container), container);
}
public static VmaDefragmentationMove create(long address) {
return new VmaDefragmentationMove(address, (ByteBuffer)null);
}
@Nullable
public static VmaDefragmentationMove createSafe(long address) {
return address == 0L ? null : new VmaDefragmentationMove(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 VmaDefragmentationMove malloc(MemoryStack stack) {
return new VmaDefragmentationMove(stack.nmalloc(ALIGNOF, SIZEOF), (ByteBuffer)null);
}
public static VmaDefragmentationMove calloc(MemoryStack stack) {
return new VmaDefragmentationMove(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 noperation(long struct) {
return UNSAFE.getInt((Object)null, struct + (long)OPERATION);
}
public static long nsrcAllocation(long struct) {
return MemoryUtil.memGetAddress(struct + (long)SRCALLOCATION);
}
public static long ndstTmpAllocation(long struct) {
return MemoryUtil.memGetAddress(struct + (long)DSTTMPALLOCATION);
}
public static void noperation(long struct, int value) {
UNSAFE.putInt((Object)null, struct + (long)OPERATION, value);
}
public static void nsrcAllocation(long struct, long value) {
MemoryUtil.memPutAddress(struct + (long)SRCALLOCATION, Checks.check(value));
}
public static void ndstTmpAllocation(long struct, long value) {
MemoryUtil.memPutAddress(struct + (long)DSTTMPALLOCATION, Checks.check(value));
}
public static void validate(long struct) {
Checks.check(MemoryUtil.memGetAddress(struct + (long)SRCALLOCATION));
Checks.check(MemoryUtil.memGetAddress(struct + (long)DSTTMPALLOCATION));
}
static {
Struct.Layout layout = __struct(new Struct.Member[]{__member(4), __member(POINTER_SIZE), __member(POINTER_SIZE)});
SIZEOF = layout.getSize();
ALIGNOF = layout.getAlignment();
OPERATION = layout.offsetof(0);
SRCALLOCATION = layout.offsetof(1);
DSTTMPALLOCATION = layout.offsetof(2);
}
public static class Buffer extends StructBuffer<VmaDefragmentationMove, Buffer> implements NativeResource {
private static final VmaDefragmentationMove ELEMENT_FACTORY = VmaDefragmentationMove.create(-1L);
public Buffer(ByteBuffer container) {
super(container, container.remaining() / VmaDefragmentationMove.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 VmaDefragmentationMove getElementFactory() {
return ELEMENT_FACTORY;
}
@NativeType("VmaDefragmentationMoveOperation")
public int operation() {
return VmaDefragmentationMove.noperation(this.address());
}
@NativeType("VmaAllocation")
public long srcAllocation() {
return VmaDefragmentationMove.nsrcAllocation(this.address());
}
@NativeType("VmaAllocation")
public long dstTmpAllocation() {
return VmaDefragmentationMove.ndstTmpAllocation(this.address());
}
public Buffer operation(@NativeType("VmaDefragmentationMoveOperation") int value) {
VmaDefragmentationMove.noperation(this.address(), value);
return this;
}
public Buffer srcAllocation(@NativeType("VmaAllocation") long value) {
VmaDefragmentationMove.nsrcAllocation(this.address(), value);
return this;
}
public Buffer dstTmpAllocation(@NativeType("VmaAllocation") long value) {
VmaDefragmentationMove.ndstTmpAllocation(this.address(), value);
return this;
}
}
}
Download file