/// <summary>
 ///
 /// </summary>
 /// <param name="pointer">
 /// </param>
 internal unsafe void MarshalTo(SharpVk.Interop.Ggp.StreamDescriptorSurfaceCreateInfo *pointer)
 {
     pointer->SType = StructureType.StreamDescriptorSurfaceCreateInfo;
     pointer->Next  = null;
     if (this.Flags != null)
     {
         pointer->Flags = this.Flags.Value;
     }
     else
     {
         pointer->Flags = default(SharpVk.Ggp.StreamDescriptorSurfaceCreateFlags);
     }
     pointer->StreamDescriptor = this.StreamDescriptor;
 }
Esempio n. 2
0
 /// <summary>
 /// Create a Surface object for a Google Games Platform stream
 /// </summary>
 /// <param name="extendedHandle">
 /// The Instance handle to extend.
 /// </param>
 /// <param name="flags">
 /// </param>
 /// <param name="streamDescriptor">
 /// </param>
 /// <param name="allocator">
 /// The allocator used for host memory allocated for the surface object
 /// when there is no more specific allocator available.
 /// </param>
 public static unsafe SharpVk.Khronos.Surface CreateStreamDescriptorSurface(this SharpVk.Instance extendedHandle, uint streamDescriptor, SharpVk.Ggp.StreamDescriptorSurfaceCreateFlags?flags = default(SharpVk.Ggp.StreamDescriptorSurfaceCreateFlags?), SharpVk.AllocationCallbacks?allocator = default(SharpVk.AllocationCallbacks?))
 {
     try
     {
         SharpVk.Khronos.Surface result       = default(SharpVk.Khronos.Surface);
         CommandCache            commandCache = default(CommandCache);
         SharpVk.Interop.Ggp.StreamDescriptorSurfaceCreateInfo *marshalledCreateInfo = default(SharpVk.Interop.Ggp.StreamDescriptorSurfaceCreateInfo *);
         void *vkStreamDescriptorSurfaceCreateInfoGGPNextPointer  = default(void *);
         SharpVk.Interop.AllocationCallbacks *marshalledAllocator = default(SharpVk.Interop.AllocationCallbacks *);
         SharpVk.Interop.Khronos.Surface      marshalledSurface   = default(SharpVk.Interop.Khronos.Surface);
         commandCache                = extendedHandle.commandCache;
         marshalledCreateInfo        = (SharpVk.Interop.Ggp.StreamDescriptorSurfaceCreateInfo *)(Interop.HeapUtil.Allocate <SharpVk.Interop.Ggp.StreamDescriptorSurfaceCreateInfo>());
         marshalledCreateInfo->SType = StructureType.StreamDescriptorSurfaceCreateInfo;
         marshalledCreateInfo->Next  = vkStreamDescriptorSurfaceCreateInfoGGPNextPointer;
         if (flags != null)
         {
             marshalledCreateInfo->Flags = flags.Value;
         }
         else
         {
             marshalledCreateInfo->Flags = default(SharpVk.Ggp.StreamDescriptorSurfaceCreateFlags);
         }
         marshalledCreateInfo->StreamDescriptor = streamDescriptor;
         if (allocator != null)
         {
             marshalledAllocator = (SharpVk.Interop.AllocationCallbacks *)(Interop.HeapUtil.Allocate <SharpVk.Interop.AllocationCallbacks>());
             allocator.Value.MarshalTo(marshalledAllocator);
         }
         else
         {
             marshalledAllocator = default(SharpVk.Interop.AllocationCallbacks *);
         }
         SharpVk.Interop.Ggp.VkInstanceCreateStreamDescriptorSurfaceDelegate commandDelegate = commandCache.Cache.vkCreateStreamDescriptorSurfaceGGP;
         Result methodResult = commandDelegate(extendedHandle.handle, marshalledCreateInfo, marshalledAllocator, &marshalledSurface);
         if (SharpVkException.IsError(methodResult))
         {
             throw SharpVkException.Create(methodResult);
         }
         result = new SharpVk.Khronos.Surface(extendedHandle, marshalledSurface);
         return(result);
     }
     finally
     {
         Interop.HeapUtil.FreeAll();
     }
 }