예제 #1
0
        public static SurfaceKhr CreateXcbSurfaceKHR(this Instance instance, XcbSurfaceCreateInfoKhr pCreateInfo, AllocationCallbacks pAllocator = null)
        {
            Result     result;
            SurfaceKhr pSurface;

            unsafe {
                pSurface = new SurfaceKhr();

                fixed(UInt64 *ptrpSurface = &pSurface.m)
                {
                    result = Linux.Interop.NativeMethods.vkCreateXcbSurfaceKHR(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 X11 window, using the XCB client-side library.
 /// </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 CreateXcbSurfaceKhr(this Instance instance,
                                              XcbSurfaceCreateInfoKhr createInfo, AllocationCallbacks?allocator = null)
 {
     return(new SurfaceKhr(instance, &createInfo, ref allocator));
 }