
org.lwjgl.openxr.XrVulkanInstanceCreateInfoKHR Maven / Gradle / Ivy
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.openxr;
import org.jspecify.annotations.*;
import java.nio.*;
import org.lwjgl.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.Checks.*;
import static org.lwjgl.system.MemoryUtil.*;
import static org.lwjgl.system.MemoryStack.*;
import org.lwjgl.vulkan.*;
/**
* Vulkan Instance Create Info.
*
* Valid Usage (Implicit)
*
*
* - The {@link KHRVulkanEnable2 XR_KHR_vulkan_enable2} extension must be enabled prior to using {@link XrVulkanInstanceCreateInfoKHR}
* - {@code type} must be {@link KHRVulkanEnable2#XR_TYPE_VULKAN_INSTANCE_CREATE_INFO_KHR TYPE_VULKAN_INSTANCE_CREATE_INFO_KHR}
* - {@code next} must be {@code NULL} or a valid pointer to the next structure in a structure chain
* - {@code createFlags} must be 0
* - {@code pfnGetInstanceProcAddr} must be a valid {@code PFN_vkGetInstanceProcAddr} value
* - {@code vulkanCreateInfo} must be a pointer to a valid {@code VkInstanceCreateInfo} value
* - If {@code vulkanAllocator} is not {@code NULL}, {@code vulkanAllocator} must be a pointer to a valid {@code VkAllocationCallbacks} value
*
*
* See Also
*
* {@link KHRVulkanEnable2#xrCreateVulkanInstanceKHR CreateVulkanInstanceKHR}
*
* Layout
*
*
* struct XrVulkanInstanceCreateInfoKHR {
* XrStructureType {@link #type};
* void const * {@link #next};
* XrSystemId {@link #systemId};
* XrVulkanInstanceCreateFlagsKHR {@link #createFlags};
* PFN_vkGetInstanceProcAddr {@link #pfnGetInstanceProcAddr};
* {@link VkInstanceCreateInfo VkInstanceCreateInfo} const * {@link #vulkanCreateInfo};
* {@link VkAllocationCallbacks VkAllocationCallbacks} const * {@link #vulkanAllocator};
* }
*/
public class XrVulkanInstanceCreateInfoKHR extends Struct implements NativeResource {
/** The struct size in bytes. */
public static final int SIZEOF;
/** The struct alignment in bytes. */
public static final int ALIGNOF;
/** The struct member offsets. */
public static final int
TYPE,
NEXT,
SYSTEMID,
CREATEFLAGS,
PFNGETINSTANCEPROCADDR,
VULKANCREATEINFO,
VULKANALLOCATOR;
static {
Layout layout = __struct(
__member(4),
__member(POINTER_SIZE),
__member(8),
__member(8),
__member(POINTER_SIZE),
__member(POINTER_SIZE),
__member(POINTER_SIZE)
);
SIZEOF = layout.getSize();
ALIGNOF = layout.getAlignment();
TYPE = layout.offsetof(0);
NEXT = layout.offsetof(1);
SYSTEMID = layout.offsetof(2);
CREATEFLAGS = layout.offsetof(3);
PFNGETINSTANCEPROCADDR = layout.offsetof(4);
VULKANCREATEINFO = layout.offsetof(5);
VULKANALLOCATOR = layout.offsetof(6);
}
protected XrVulkanInstanceCreateInfoKHR(long address, @Nullable ByteBuffer container) {
super(address, container);
}
@Override
protected XrVulkanInstanceCreateInfoKHR create(long address, @Nullable ByteBuffer container) {
return new XrVulkanInstanceCreateInfoKHR(address, container);
}
/**
* Creates a {@code XrVulkanInstanceCreateInfoKHR} instance at the current position of the specified {@link 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.
*/
public XrVulkanInstanceCreateInfoKHR(ByteBuffer container) {
super(memAddress(container), __checkContainer(container, SIZEOF));
}
@Override
public int sizeof() { return SIZEOF; }
/** the {@code XrStructureType} of this structure. */
@NativeType("XrStructureType")
public int type() { return ntype(address()); }
/** {@code NULL} or a pointer to the next structure in a structure chain. No such structures are defined in core OpenXR or this extension */
@NativeType("void const *")
public long next() { return nnext(address()); }
/** an {@code XrSystemId} handle for the system which will be used to create a session. */
@NativeType("XrSystemId")
public long systemId() { return nsystemId(address()); }
/** a bitmask of {@code XrVulkanInstanceCreateFlagBitsKHR} */
@NativeType("XrVulkanInstanceCreateFlagsKHR")
public long createFlags() { return ncreateFlags(address()); }
/** a function pointer to {@code vkGetInstanceProcAddr} or a compatible entry point. */
@NativeType("PFN_vkGetInstanceProcAddr")
public long pfnGetInstanceProcAddr() { return npfnGetInstanceProcAddr(address()); }
/** the {@code VkInstanceCreateInfo} as specified by Vulkan. */
@NativeType("VkInstanceCreateInfo const *")
public VkInstanceCreateInfo vulkanCreateInfo() { return nvulkanCreateInfo(address()); }
/** the {@code VkAllocationCallbacks} as specified by Vulkan. */
@NativeType("VkAllocationCallbacks const *")
public @Nullable VkAllocationCallbacks vulkanAllocator() { return nvulkanAllocator(address()); }
/** Sets the specified value to the {@link #type} field. */
public XrVulkanInstanceCreateInfoKHR type(@NativeType("XrStructureType") int value) { ntype(address(), value); return this; }
/** Sets the {@link KHRVulkanEnable2#XR_TYPE_VULKAN_INSTANCE_CREATE_INFO_KHR TYPE_VULKAN_INSTANCE_CREATE_INFO_KHR} value to the {@link #type} field. */
public XrVulkanInstanceCreateInfoKHR type$Default() { return type(KHRVulkanEnable2.XR_TYPE_VULKAN_INSTANCE_CREATE_INFO_KHR); }
/** Sets the specified value to the {@link #next} field. */
public XrVulkanInstanceCreateInfoKHR next(@NativeType("void const *") long value) { nnext(address(), value); return this; }
/** Sets the specified value to the {@link #systemId} field. */
public XrVulkanInstanceCreateInfoKHR systemId(@NativeType("XrSystemId") long value) { nsystemId(address(), value); return this; }
/** Sets the specified value to the {@link #createFlags} field. */
public XrVulkanInstanceCreateInfoKHR createFlags(@NativeType("XrVulkanInstanceCreateFlagsKHR") long value) { ncreateFlags(address(), value); return this; }
/** Sets the specified value to the {@link #pfnGetInstanceProcAddr} field. */
public XrVulkanInstanceCreateInfoKHR pfnGetInstanceProcAddr(@NativeType("PFN_vkGetInstanceProcAddr") long value) { npfnGetInstanceProcAddr(address(), value); return this; }
/** Sets the address of the specified {@link VkInstanceCreateInfo} to the {@link #vulkanCreateInfo} field. */
public XrVulkanInstanceCreateInfoKHR vulkanCreateInfo(@NativeType("VkInstanceCreateInfo const *") VkInstanceCreateInfo value) { nvulkanCreateInfo(address(), value); return this; }
/** Sets the address of the specified {@link VkAllocationCallbacks} to the {@link #vulkanAllocator} field. */
public XrVulkanInstanceCreateInfoKHR vulkanAllocator(@Nullable @NativeType("VkAllocationCallbacks const *") VkAllocationCallbacks value) { nvulkanAllocator(address(), value); return this; }
/** Initializes this struct with the specified values. */
public XrVulkanInstanceCreateInfoKHR set(
int type,
long next,
long systemId,
long createFlags,
long pfnGetInstanceProcAddr,
VkInstanceCreateInfo vulkanCreateInfo,
@Nullable VkAllocationCallbacks vulkanAllocator
) {
type(type);
next(next);
systemId(systemId);
createFlags(createFlags);
pfnGetInstanceProcAddr(pfnGetInstanceProcAddr);
vulkanCreateInfo(vulkanCreateInfo);
vulkanAllocator(vulkanAllocator);
return this;
}
/**
* Copies the specified struct data to this struct.
*
* @param src the source struct
*
* @return this struct
*/
public XrVulkanInstanceCreateInfoKHR set(XrVulkanInstanceCreateInfoKHR src) {
memCopy(src.address(), address(), SIZEOF);
return this;
}
// -----------------------------------
/** Returns a new {@code XrVulkanInstanceCreateInfoKHR} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */
public static XrVulkanInstanceCreateInfoKHR malloc() {
return new XrVulkanInstanceCreateInfoKHR(nmemAllocChecked(SIZEOF), null);
}
/** Returns a new {@code XrVulkanInstanceCreateInfoKHR} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */
public static XrVulkanInstanceCreateInfoKHR calloc() {
return new XrVulkanInstanceCreateInfoKHR(nmemCallocChecked(1, SIZEOF), null);
}
/** Returns a new {@code XrVulkanInstanceCreateInfoKHR} instance allocated with {@link BufferUtils}. */
public static XrVulkanInstanceCreateInfoKHR create() {
ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF);
return new XrVulkanInstanceCreateInfoKHR(memAddress(container), container);
}
/** Returns a new {@code XrVulkanInstanceCreateInfoKHR} instance for the specified memory address. */
public static XrVulkanInstanceCreateInfoKHR create(long address) {
return new XrVulkanInstanceCreateInfoKHR(address, null);
}
/** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */
public static @Nullable XrVulkanInstanceCreateInfoKHR createSafe(long address) {
return address == NULL ? null : new XrVulkanInstanceCreateInfoKHR(address, null);
}
/**
* Returns a new {@link XrVulkanInstanceCreateInfoKHR.Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed.
*
* @param capacity the buffer capacity
*/
public static XrVulkanInstanceCreateInfoKHR.Buffer malloc(int capacity) {
return new Buffer(nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity);
}
/**
* Returns a new {@link XrVulkanInstanceCreateInfoKHR.Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed.
*
* @param capacity the buffer capacity
*/
public static XrVulkanInstanceCreateInfoKHR.Buffer calloc(int capacity) {
return new Buffer(nmemCallocChecked(capacity, SIZEOF), capacity);
}
/**
* Returns a new {@link XrVulkanInstanceCreateInfoKHR.Buffer} instance allocated with {@link BufferUtils}.
*
* @param capacity the buffer capacity
*/
public static XrVulkanInstanceCreateInfoKHR.Buffer create(int capacity) {
ByteBuffer container = __create(capacity, SIZEOF);
return new Buffer(memAddress(container), container, -1, 0, capacity, capacity);
}
/**
* Create a {@link XrVulkanInstanceCreateInfoKHR.Buffer} instance at the specified memory.
*
* @param address the memory address
* @param capacity the buffer capacity
*/
public static XrVulkanInstanceCreateInfoKHR.Buffer create(long address, int capacity) {
return new Buffer(address, capacity);
}
/** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */
public static XrVulkanInstanceCreateInfoKHR.@Nullable Buffer createSafe(long address, int capacity) {
return address == NULL ? null : new Buffer(address, capacity);
}
/**
* Returns a new {@code XrVulkanInstanceCreateInfoKHR} instance allocated on the specified {@link MemoryStack}.
*
* @param stack the stack from which to allocate
*/
public static XrVulkanInstanceCreateInfoKHR malloc(MemoryStack stack) {
return new XrVulkanInstanceCreateInfoKHR(stack.nmalloc(ALIGNOF, SIZEOF), null);
}
/**
* Returns a new {@code XrVulkanInstanceCreateInfoKHR} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero.
*
* @param stack the stack from which to allocate
*/
public static XrVulkanInstanceCreateInfoKHR calloc(MemoryStack stack) {
return new XrVulkanInstanceCreateInfoKHR(stack.ncalloc(ALIGNOF, 1, SIZEOF), null);
}
/**
* Returns a new {@link XrVulkanInstanceCreateInfoKHR.Buffer} instance allocated on the specified {@link MemoryStack}.
*
* @param stack the stack from which to allocate
* @param capacity the buffer capacity
*/
public static XrVulkanInstanceCreateInfoKHR.Buffer malloc(int capacity, MemoryStack stack) {
return new Buffer(stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity);
}
/**
* Returns a new {@link XrVulkanInstanceCreateInfoKHR.Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero.
*
* @param stack the stack from which to allocate
* @param capacity the buffer capacity
*/
public static XrVulkanInstanceCreateInfoKHR.Buffer calloc(int capacity, MemoryStack stack) {
return new Buffer(stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity);
}
// -----------------------------------
/** Unsafe version of {@link #type}. */
public static int ntype(long struct) { return memGetInt(struct + XrVulkanInstanceCreateInfoKHR.TYPE); }
/** Unsafe version of {@link #next}. */
public static long nnext(long struct) { return memGetAddress(struct + XrVulkanInstanceCreateInfoKHR.NEXT); }
/** Unsafe version of {@link #systemId}. */
public static long nsystemId(long struct) { return memGetLong(struct + XrVulkanInstanceCreateInfoKHR.SYSTEMID); }
/** Unsafe version of {@link #createFlags}. */
public static long ncreateFlags(long struct) { return memGetLong(struct + XrVulkanInstanceCreateInfoKHR.CREATEFLAGS); }
/** Unsafe version of {@link #pfnGetInstanceProcAddr}. */
public static long npfnGetInstanceProcAddr(long struct) { return memGetAddress(struct + XrVulkanInstanceCreateInfoKHR.PFNGETINSTANCEPROCADDR); }
/** Unsafe version of {@link #vulkanCreateInfo}. */
public static VkInstanceCreateInfo nvulkanCreateInfo(long struct) { return VkInstanceCreateInfo.create(memGetAddress(struct + XrVulkanInstanceCreateInfoKHR.VULKANCREATEINFO)); }
/** Unsafe version of {@link #vulkanAllocator}. */
public static @Nullable VkAllocationCallbacks nvulkanAllocator(long struct) { return VkAllocationCallbacks.createSafe(memGetAddress(struct + XrVulkanInstanceCreateInfoKHR.VULKANALLOCATOR)); }
/** Unsafe version of {@link #type(int) type}. */
public static void ntype(long struct, int value) { memPutInt(struct + XrVulkanInstanceCreateInfoKHR.TYPE, value); }
/** Unsafe version of {@link #next(long) next}. */
public static void nnext(long struct, long value) { memPutAddress(struct + XrVulkanInstanceCreateInfoKHR.NEXT, value); }
/** Unsafe version of {@link #systemId(long) systemId}. */
public static void nsystemId(long struct, long value) { memPutLong(struct + XrVulkanInstanceCreateInfoKHR.SYSTEMID, value); }
/** Unsafe version of {@link #createFlags(long) createFlags}. */
public static void ncreateFlags(long struct, long value) { memPutLong(struct + XrVulkanInstanceCreateInfoKHR.CREATEFLAGS, value); }
/** Unsafe version of {@link #pfnGetInstanceProcAddr(long) pfnGetInstanceProcAddr}. */
public static void npfnGetInstanceProcAddr(long struct, long value) { memPutAddress(struct + XrVulkanInstanceCreateInfoKHR.PFNGETINSTANCEPROCADDR, check(value)); }
/** Unsafe version of {@link #vulkanCreateInfo(VkInstanceCreateInfo) vulkanCreateInfo}. */
public static void nvulkanCreateInfo(long struct, VkInstanceCreateInfo value) { memPutAddress(struct + XrVulkanInstanceCreateInfoKHR.VULKANCREATEINFO, value.address()); }
/** Unsafe version of {@link #vulkanAllocator(VkAllocationCallbacks) vulkanAllocator}. */
public static void nvulkanAllocator(long struct, @Nullable VkAllocationCallbacks value) { memPutAddress(struct + XrVulkanInstanceCreateInfoKHR.VULKANALLOCATOR, memAddressSafe(value)); }
/**
* Validates pointer members that should not be {@code NULL}.
*
* @param struct the struct to validate
*/
public static void validate(long struct) {
check(memGetAddress(struct + XrVulkanInstanceCreateInfoKHR.PFNGETINSTANCEPROCADDR));
long vulkanCreateInfo = memGetAddress(struct + XrVulkanInstanceCreateInfoKHR.VULKANCREATEINFO);
check(vulkanCreateInfo);
VkInstanceCreateInfo.validate(vulkanCreateInfo);
}
// -----------------------------------
/** An array of {@link XrVulkanInstanceCreateInfoKHR} structs. */
public static class Buffer extends StructBuffer implements NativeResource {
private static final XrVulkanInstanceCreateInfoKHR ELEMENT_FACTORY = XrVulkanInstanceCreateInfoKHR.create(-1L);
/**
* Creates a new {@code XrVulkanInstanceCreateInfoKHR.Buffer} instance backed by the specified container.
*
* Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values
* will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided
* by {@link XrVulkanInstanceCreateInfoKHR#SIZEOF}, and its mark will be undefined.
*
* The created buffer instance holds a strong reference to the container object.
*/
public Buffer(ByteBuffer container) {
super(container, container.remaining() / SIZEOF);
}
public Buffer(long address, int cap) {
super(address, 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);
}
@Override
protected Buffer self() {
return this;
}
@Override
protected Buffer create(long address, @Nullable ByteBuffer container, int mark, int position, int limit, int capacity) {
return new Buffer(address, container, mark, position, limit, capacity);
}
@Override
protected XrVulkanInstanceCreateInfoKHR getElementFactory() {
return ELEMENT_FACTORY;
}
/** @return the value of the {@link XrVulkanInstanceCreateInfoKHR#type} field. */
@NativeType("XrStructureType")
public int type() { return XrVulkanInstanceCreateInfoKHR.ntype(address()); }
/** @return the value of the {@link XrVulkanInstanceCreateInfoKHR#next} field. */
@NativeType("void const *")
public long next() { return XrVulkanInstanceCreateInfoKHR.nnext(address()); }
/** @return the value of the {@link XrVulkanInstanceCreateInfoKHR#systemId} field. */
@NativeType("XrSystemId")
public long systemId() { return XrVulkanInstanceCreateInfoKHR.nsystemId(address()); }
/** @return the value of the {@link XrVulkanInstanceCreateInfoKHR#createFlags} field. */
@NativeType("XrVulkanInstanceCreateFlagsKHR")
public long createFlags() { return XrVulkanInstanceCreateInfoKHR.ncreateFlags(address()); }
/** @return the value of the {@link XrVulkanInstanceCreateInfoKHR#pfnGetInstanceProcAddr} field. */
@NativeType("PFN_vkGetInstanceProcAddr")
public long pfnGetInstanceProcAddr() { return XrVulkanInstanceCreateInfoKHR.npfnGetInstanceProcAddr(address()); }
/** @return a {@link VkInstanceCreateInfo} view of the struct pointed to by the {@link XrVulkanInstanceCreateInfoKHR#vulkanCreateInfo} field. */
@NativeType("VkInstanceCreateInfo const *")
public VkInstanceCreateInfo vulkanCreateInfo() { return XrVulkanInstanceCreateInfoKHR.nvulkanCreateInfo(address()); }
/** @return a {@link VkAllocationCallbacks} view of the struct pointed to by the {@link XrVulkanInstanceCreateInfoKHR#vulkanAllocator} field. */
@NativeType("VkAllocationCallbacks const *")
public @Nullable VkAllocationCallbacks vulkanAllocator() { return XrVulkanInstanceCreateInfoKHR.nvulkanAllocator(address()); }
/** Sets the specified value to the {@link XrVulkanInstanceCreateInfoKHR#type} field. */
public XrVulkanInstanceCreateInfoKHR.Buffer type(@NativeType("XrStructureType") int value) { XrVulkanInstanceCreateInfoKHR.ntype(address(), value); return this; }
/** Sets the {@link KHRVulkanEnable2#XR_TYPE_VULKAN_INSTANCE_CREATE_INFO_KHR TYPE_VULKAN_INSTANCE_CREATE_INFO_KHR} value to the {@link XrVulkanInstanceCreateInfoKHR#type} field. */
public XrVulkanInstanceCreateInfoKHR.Buffer type$Default() { return type(KHRVulkanEnable2.XR_TYPE_VULKAN_INSTANCE_CREATE_INFO_KHR); }
/** Sets the specified value to the {@link XrVulkanInstanceCreateInfoKHR#next} field. */
public XrVulkanInstanceCreateInfoKHR.Buffer next(@NativeType("void const *") long value) { XrVulkanInstanceCreateInfoKHR.nnext(address(), value); return this; }
/** Sets the specified value to the {@link XrVulkanInstanceCreateInfoKHR#systemId} field. */
public XrVulkanInstanceCreateInfoKHR.Buffer systemId(@NativeType("XrSystemId") long value) { XrVulkanInstanceCreateInfoKHR.nsystemId(address(), value); return this; }
/** Sets the specified value to the {@link XrVulkanInstanceCreateInfoKHR#createFlags} field. */
public XrVulkanInstanceCreateInfoKHR.Buffer createFlags(@NativeType("XrVulkanInstanceCreateFlagsKHR") long value) { XrVulkanInstanceCreateInfoKHR.ncreateFlags(address(), value); return this; }
/** Sets the specified value to the {@link XrVulkanInstanceCreateInfoKHR#pfnGetInstanceProcAddr} field. */
public XrVulkanInstanceCreateInfoKHR.Buffer pfnGetInstanceProcAddr(@NativeType("PFN_vkGetInstanceProcAddr") long value) { XrVulkanInstanceCreateInfoKHR.npfnGetInstanceProcAddr(address(), value); return this; }
/** Sets the address of the specified {@link VkInstanceCreateInfo} to the {@link XrVulkanInstanceCreateInfoKHR#vulkanCreateInfo} field. */
public XrVulkanInstanceCreateInfoKHR.Buffer vulkanCreateInfo(@NativeType("VkInstanceCreateInfo const *") VkInstanceCreateInfo value) { XrVulkanInstanceCreateInfoKHR.nvulkanCreateInfo(address(), value); return this; }
/** Sets the address of the specified {@link VkAllocationCallbacks} to the {@link XrVulkanInstanceCreateInfoKHR#vulkanAllocator} field. */
public XrVulkanInstanceCreateInfoKHR.Buffer vulkanAllocator(@Nullable @NativeType("VkAllocationCallbacks const *") VkAllocationCallbacks value) { XrVulkanInstanceCreateInfoKHR.nvulkanAllocator(address(), value); return this; }
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy