Exemplo n.º 1
0
        public static SurfaceKhr CreateWaylandSurfaceKHR(this Instance instance, WaylandSurfaceCreateInfoKhr pCreateInfo, AllocationCallbacks pAllocator = null)
        {
            Result     result;
            SurfaceKhr pSurface;

            unsafe {
                pSurface = new SurfaceKhr();

                fixed(UInt64 *ptrpSurface = &pSurface.m)
                {
                    result = Linux.Interop.NativeMethods.vkCreateWaylandSurfaceKHR(instance.m, pCreateInfo.m, pAllocator != null ? pAllocator.m : null, ptrpSurface);
                }

                if (result != Result.Success)
                {
                    throw new ResultException(result);
                }

                return(pSurface);
            }
        }
 /// <summary>
 /// Create a <see cref="SurfaceKhr"/> object for a Wayland window.
 /// </summary>
 /// <param name="instance">The <see cref="Instance"/> to associate with the surface.</param>
 /// <param name="createInfo">
 /// The structure containing the parameters affecting the creation of the surface object.
 /// </param>
 /// <param name="allocator">
 /// The allocator used for host memory allocated for the surface object.
 /// </param>
 /// <returns>The resulting surface object handle.</returns>
 /// <exception cref="VulkanException">Vulkan returns an error code.</exception>
 public static SurfaceKhr CreateWaylandSurfaceKhr(this Instance instance,
                                                  WaylandSurfaceCreateInfoKhr createInfo, AllocationCallbacks?allocator = null)
 {
     return(new SurfaceKhr(instance, &createInfo, ref allocator));
 }