org.lwjgl.vulkan.MVKIosSurface Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lwjgl-vulkan Show documentation
Show all versions of lwjgl-vulkan Show documentation
A new generation graphics and compute API that provides high-efficiency, cross-platform access to modern GPUs used in a wide variety of devices from PCs and consoles to mobile phones and embedded platforms.
/*
* Copyright LWJGL. All rights reserved.
* License terms: https://www.lwjgl.org/license
* MACHINE GENERATED FILE, DO NOT EDIT
*/
package org.lwjgl.vulkan;
import javax.annotation.*;
import java.nio.*;
import org.lwjgl.system.*;
import static org.lwjgl.system.Checks.*;
import static org.lwjgl.system.JNI.*;
import static org.lwjgl.system.MemoryUtil.*;
/**
* The {@code VK_MVK_ios_surface} extension is an instance extension. It provides a mechanism to create a {@code VkSurfaceKHR} object (defined by the {@link KHRSurface VK_KHR_surface} extension) that refers to a {@code UIView}, the native surface type of iOS, which is underpinned by a {@code CAMetalLayer}, to support rendering to the surface using Apple's Metal framework.
*
*
* - Name String
* - {@code VK_MVK_ios_surface}
* - Extension Type
* - Instance extension
* - Registered Extension Number
* - 123
* - Revision
* - 2
* - Extension and Version Dependencies
*
* - Requires Vulkan 1.0
* - Requires {@link KHRSurface VK_KHR_surface}
*
* - Contact
*
* - Bill Hollings @billhollings
*
* - Last Modified Date
* - 2017-02-24
* - IP Status
* - No known IP claims.
* - Contributors
*
* - Bill Hollings, The Brenwill Workshop Ltd.
*
*
*/
public class MVKIosSurface {
/** The extension specification version. */
public static final int VK_MVK_IOS_SURFACE_SPEC_VERSION = 2;
/** The extension name. */
public static final String VK_MVK_IOS_SURFACE_EXTENSION_NAME = "VK_MVK_ios_surface";
/** Extends {@code VkStructureType}. */
public static final int VK_STRUCTURE_TYPE_IOS_SURFACE_CREATE_INFO_MVK = 1000122000;
protected MVKIosSurface() {
throw new UnsupportedOperationException();
}
static boolean isAvailable(VKCapabilitiesInstance caps) {
return checkFunctions(
caps.vkCreateIOSSurfaceMVK
);
}
// --- [ vkCreateIOSSurfaceMVK ] ---
/** Unsafe version of: {@link #vkCreateIOSSurfaceMVK CreateIOSSurfaceMVK} */
public static int nvkCreateIOSSurfaceMVK(VkInstance instance, long pCreateInfo, long pAllocator, long pSurface) {
long __functionAddress = instance.getCapabilities().vkCreateIOSSurfaceMVK;
if (CHECKS) {
check(__functionAddress);
VkIOSSurfaceCreateInfoMVK.validate(pCreateInfo);
if (pAllocator != NULL) { VkAllocationCallbacks.validate(pAllocator); }
}
return callPPPPI(__functionAddress, instance.address(), pCreateInfo, pAllocator, pSurface);
}
/**
* Create a VkSurfaceKHR object for an iOS UIView.
*
* C Specification
*
* To create a {@code VkSurfaceKHR} object for an iOS {@code UIView}, call:
*
*
* VkResult vkCreateIOSSurfaceMVK(
* VkInstance instance,
* const VkIOSSurfaceCreateInfoMVK* pCreateInfo,
* const VkAllocationCallbacks* pAllocator,
* VkSurfaceKHR* pSurface);
*
* Valid Usage (Implicit)
*
*
* - {@code instance} must be a valid {@code VkInstance} handle
* - {@code pCreateInfo} must be a valid pointer to a valid {@link VkIOSSurfaceCreateInfoMVK} structure
* - If {@code pAllocator} is not {@code NULL}, {@code pAllocator} must be a valid pointer to a valid {@link VkAllocationCallbacks} structure
* - {@code pSurface} must be a valid pointer to a {@code VkSurfaceKHR} handle
*
*
* Return Codes
*
*
* - On success, this command returns
*
* - {@link VK10#VK_SUCCESS SUCCESS}
*
* - On failure, this command returns
*
* - {@link VK10#VK_ERROR_OUT_OF_HOST_MEMORY ERROR_OUT_OF_HOST_MEMORY}
* - {@link VK10#VK_ERROR_OUT_OF_DEVICE_MEMORY ERROR_OUT_OF_DEVICE_MEMORY}
* - {@link KHRSurface#VK_ERROR_NATIVE_WINDOW_IN_USE_KHR ERROR_NATIVE_WINDOW_IN_USE_KHR}
*
*
*
* See Also
*
* {@link VkAllocationCallbacks}, {@link VkIOSSurfaceCreateInfoMVK}
*
* @param instance the instance with which to associate the surface.
* @param pCreateInfo a pointer to an instance of the {@link VkIOSSurfaceCreateInfoMVK} structure containing parameters affecting the creation of the surface object.
* @param pAllocator the allocator used for host memory allocated for the surface object when there is no more specific allocator available (see Memory Allocation).
* @param pSurface points to a {@code VkSurfaceKHR} handle in which the created surface object is returned.
*/
@NativeType("VkResult")
public static int vkCreateIOSSurfaceMVK(VkInstance instance, @NativeType("const VkIOSSurfaceCreateInfoMVK *") VkIOSSurfaceCreateInfoMVK pCreateInfo, @Nullable @NativeType("const VkAllocationCallbacks *") VkAllocationCallbacks pAllocator, @NativeType("VkSurfaceKHR *") LongBuffer pSurface) {
if (CHECKS) {
check(pSurface, 1);
}
return nvkCreateIOSSurfaceMVK(instance, pCreateInfo.address(), memAddressSafe(pAllocator), memAddress(pSurface));
}
/** Array version of: {@link #vkCreateIOSSurfaceMVK CreateIOSSurfaceMVK} */
@NativeType("VkResult")
public static int vkCreateIOSSurfaceMVK(VkInstance instance, @NativeType("const VkIOSSurfaceCreateInfoMVK *") VkIOSSurfaceCreateInfoMVK pCreateInfo, @Nullable @NativeType("const VkAllocationCallbacks *") VkAllocationCallbacks pAllocator, @NativeType("VkSurfaceKHR *") long[] pSurface) {
long __functionAddress = instance.getCapabilities().vkCreateIOSSurfaceMVK;
if (CHECKS) {
check(__functionAddress);
check(pSurface, 1);
VkIOSSurfaceCreateInfoMVK.validate(pCreateInfo.address());
if (pAllocator != null) { VkAllocationCallbacks.validate(pAllocator.address()); }
}
return callPPPPI(__functionAddress, instance.address(), pCreateInfo.address(), memAddressSafe(pAllocator), pSurface);
}
}