Beispiel #1
0
 /// <summary>
 ///
 /// </summary>
 public DisplayPlaneCapabilities(SharpVk.Khronos.DisplayPlaneAlphaFlags supportedAlpha, SharpVk.Offset2D minSourcePosition, SharpVk.Offset2D maxSourcePosition, SharpVk.Extent2D minSourceExtent, SharpVk.Extent2D maxSourceExtent, SharpVk.Offset2D minDestinationPosition, SharpVk.Offset2D maxDestinationPosition, SharpVk.Extent2D minDestinationExtent, SharpVk.Extent2D maxDestinationExtent)
 {
     this.SupportedAlpha         = supportedAlpha;
     this.MinSourcePosition      = minSourcePosition;
     this.MaxSourcePosition      = maxSourcePosition;
     this.MinSourceExtent        = minSourceExtent;
     this.MaxSourceExtent        = maxSourceExtent;
     this.MinDestinationPosition = minDestinationPosition;
     this.MaxDestinationPosition = maxDestinationPosition;
     this.MinDestinationExtent   = minDestinationExtent;
     this.MaxDestinationExtent   = maxDestinationExtent;
 }
Beispiel #2
0
 /// <summary>
 /// Create a SurfaceKHR structure representing a display plane and
 /// mode.
 /// </summary>
 /// <param name="extendedHandle">
 /// The Instance handle to extend.
 /// </param>
 /// <param name="flags">
 /// Reserved for future use, and must be zero.
 /// </param>
 /// <param name="displayMode">
 /// The mode to use when displaying this surface.
 /// </param>
 /// <param name="planeIndex">
 /// The plane on which this surface appears.
 /// </param>
 /// <param name="planeStackIndex">
 /// The z-order of the plane.
 /// </param>
 /// <param name="transform">
 /// The transform to apply to the images as part of the scanout
 /// operation.
 /// </param>
 /// <param name="globalAlpha">
 /// The global alpha value. This value is ignored if alphaMode is not
 /// VK_DISPLAY_PLANE_ALPHA_GLOBAL_BIT_KHR.
 /// </param>
 /// <param name="alphaMode">
 /// The type of alpha blending to use.
 /// </param>
 /// <param name="imageExtent">
 /// </param>
 /// <param name="allocator">
 /// An optional AllocationCallbacks instance that controls host memory
 /// allocation.
 /// </param>
 public static unsafe SharpVk.Khronos.Surface CreateDisplayPlaneSurface(this SharpVk.Instance extendedHandle, SharpVk.Khronos.DisplayMode displayMode, uint planeIndex, uint planeStackIndex, SharpVk.Khronos.SurfaceTransformFlags transform, float globalAlpha, SharpVk.Khronos.DisplayPlaneAlphaFlags alphaMode, SharpVk.Extent2D imageExtent, SharpVk.Khronos.DisplaySurfaceCreateFlags?flags = default(SharpVk.Khronos.DisplaySurfaceCreateFlags?), SharpVk.AllocationCallbacks?allocator = default(SharpVk.AllocationCallbacks?))
 {
     try
     {
         SharpVk.Khronos.Surface result       = default(SharpVk.Khronos.Surface);
         CommandCache            commandCache = default(CommandCache);
         SharpVk.Interop.Khronos.DisplaySurfaceCreateInfo *marshalledCreateInfo = default(SharpVk.Interop.Khronos.DisplaySurfaceCreateInfo *);
         void *vkDisplaySurfaceCreateInfoKHRNextPointer           = 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.Khronos.DisplaySurfaceCreateInfo *)(Interop.HeapUtil.Allocate <SharpVk.Interop.Khronos.DisplaySurfaceCreateInfo>());
         marshalledCreateInfo->SType = StructureType.DisplaySurfaceCreateInfo;
         marshalledCreateInfo->Next  = vkDisplaySurfaceCreateInfoKHRNextPointer;
         if (flags != null)
         {
             marshalledCreateInfo->Flags = flags.Value;
         }
         else
         {
             marshalledCreateInfo->Flags = default(SharpVk.Khronos.DisplaySurfaceCreateFlags);
         }
         marshalledCreateInfo->DisplayMode     = displayMode?.handle ?? default(SharpVk.Interop.Khronos.DisplayMode);
         marshalledCreateInfo->PlaneIndex      = planeIndex;
         marshalledCreateInfo->PlaneStackIndex = planeStackIndex;
         marshalledCreateInfo->Transform       = transform;
         marshalledCreateInfo->GlobalAlpha     = globalAlpha;
         marshalledCreateInfo->AlphaMode       = alphaMode;
         marshalledCreateInfo->ImageExtent     = imageExtent;
         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.Khronos.VkInstanceCreateDisplayPlaneSurfaceDelegate commandDelegate = commandCache.Cache.vkCreateDisplayPlaneSurfaceKHR;
         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();
     }
 }