org.lwjgl.vulkan.MVKMacosSurface 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 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_macos_surface} extension is an instance extension. It provides a mechanism to create a {@code VkSurfaceKHR} object (defined by the {@code VK_KHR_surface} extension) that refers to an {@code NSView}, the native surface type of macOS, which is underpinned by a {@code CAMetalLayer}, to support rendering to the surface using Apple's Metal framework.
*
*
* - Name String
* - {@code VK_MVK_macos_surface}
* - Extension Type
* - Instance extension
* - Registered Extension Number
* - 124
* - Revision
* - 2
* - Extension and Version Dependencies
*
* - Requires Vulkan 1.0
* - Requires {@code 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 MVKMacosSurface {
/** The extension specification version. */
public static final int VK_MVK_MACOS_SURFACE_SPEC_VERSION = 2;
/** The extension name. */
public static final String VK_MVK_MACOS_SURFACE_EXTENSION_NAME = "VK_MVK_macos_surface";
/** Extends {@code VkStructureType}. */
public static final int VK_STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK = 1000123000;
protected MVKMacosSurface() {
throw new UnsupportedOperationException();
}
static boolean isAvailable(VKCapabilitiesInstance caps) {
return checkFunctions(
caps.vkCreateMacOSSurfaceMVK
);
}
// --- [ vkCreateMacOSSurfaceMVK ] ---
/** Unsafe version of: {@link #vkCreateMacOSSurfaceMVK CreateMacOSSurfaceMVK} */
public static int nvkCreateMacOSSurfaceMVK(VkInstance instance, long pCreateInfo, long pAllocator, long pSurface) {
long __functionAddress = instance.getCapabilities().vkCreateMacOSSurfaceMVK;
if (CHECKS) {
check(__functionAddress);
VkMacOSSurfaceCreateInfoMVK.validate(pCreateInfo);
if (pAllocator != NULL) { VkAllocationCallbacks.validate(pAllocator); }
}
return callPPPPI(__functionAddress, instance.address(), pCreateInfo, pAllocator, pSurface);
}
/**
* Create a VkSurfaceKHR object for a macOS NSView.
*
* C Specification
*
* To create a {@code VkSurfaceKHR} object for a macOS {@code NSView}, call:
*
*
* VkResult vkCreateMacOSSurfaceMVK(
* VkInstance instance,
* const VkMacOSSurfaceCreateInfoMVK* pCreateInfo,
* const VkAllocationCallbacks* pAllocator,
* VkSurfaceKHR* pSurface);
*
* Valid Usage (Implicit)
*
*
* - {@code instance} must be a valid {@code VkInstance} handle
* - {@code pCreateInfo} must be a pointer to a valid {@link VkMacOSSurfaceCreateInfoMVK} structure
* - If {@code pAllocator} is not {@code NULL}, {@code pAllocator} must be a pointer to a valid {@link VkAllocationCallbacks} structure
* - {@code pSurface} must be a 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 VkMacOSSurfaceCreateInfoMVK}
*
* @param instance the instance with which to associate the surface.
* @param pCreateInfo a pointer to an instance of the {@link VkMacOSSurfaceCreateInfoMVK} 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 vkCreateMacOSSurfaceMVK(VkInstance instance, @NativeType("const VkMacOSSurfaceCreateInfoMVK *") VkMacOSSurfaceCreateInfoMVK pCreateInfo, @NativeType("const VkAllocationCallbacks *") VkAllocationCallbacks pAllocator, @NativeType("VkSurfaceKHR *") LongBuffer pSurface) {
if (CHECKS) {
check(pSurface, 1);
}
return nvkCreateMacOSSurfaceMVK(instance, pCreateInfo.address(), memAddressSafe(pAllocator), memAddress(pSurface));
}
/** Array version of: {@link #vkCreateMacOSSurfaceMVK CreateMacOSSurfaceMVK} */
@NativeType("VkResult")
public static int vkCreateMacOSSurfaceMVK(VkInstance instance, @NativeType("const VkMacOSSurfaceCreateInfoMVK *") VkMacOSSurfaceCreateInfoMVK pCreateInfo, @NativeType("const VkAllocationCallbacks *") VkAllocationCallbacks pAllocator, @NativeType("VkSurfaceKHR *") long[] pSurface) {
long __functionAddress = instance.getCapabilities().vkCreateMacOSSurfaceMVK;
if (CHECKS) {
check(__functionAddress);
check(pSurface, 1);
VkMacOSSurfaceCreateInfoMVK.validate(pCreateInfo.address());
if (pAllocator != null) { VkAllocationCallbacks.validate(pAllocator.address()); }
}
return callPPPPI(__functionAddress, instance.address(), pCreateInfo.address(), memAddressSafe(pAllocator), pSurface);
}
}