Exemplo n.º 1
0
        public static SurfaceKhr CreateAndroidSurfaceKHR(this Instance instance, AndroidSurfaceCreateInfoKhr pCreateInfo, AllocationCallbacks pAllocator)
        {
            Result result;
            SurfaceKhr pSurface;
            unsafe {
                pSurface = new SurfaceKhr ();

                fixed (UInt64* ptrpSurface = &pSurface.m) {
                    result = Android.Interop.NativeMethods.vkCreateAndroidSurfaceKHR (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 an Android native 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 CreateAndroidSurfaceKhr(this Instance instance,
                                                  AndroidSurfaceCreateInfoKhr createInfo, AllocationCallbacks?allocator = null)
 {
     return(new SurfaceKhr(instance, &createInfo, ref allocator));
 }