module Graphics.Vulkan.Types.Struct.Viewport
(VkViewport(..), VkViewportSwizzleNV(..), VkViewportWScalingNV(..))
where
import Foreign.Storable (Storable (..))
import GHC.Base (Addr#, ByteArray#,
byteArrayContents#,
plusAddr#)
import Graphics.Vulkan.Marshal
import Graphics.Vulkan.Marshal.Internal
import Graphics.Vulkan.Types.Enum.ViewportCoordinateSwizzleNV (VkViewportCoordinateSwizzleNV)
import System.IO.Unsafe (unsafeDupablePerformIO)
data VkViewport = VkViewport# Addr# ByteArray#
instance Eq VkViewport where
(VkViewport# a _) == x@(VkViewport# b _)
= EQ == cmpBytes# (sizeOf x) a b
instance Ord VkViewport where
(VkViewport# a _) `compare` x@(VkViewport# b _)
= cmpBytes# (sizeOf x) a b
instance Storable VkViewport where
sizeOf ~_ = (24)
alignment ~_ = (4)
peek = peekVkData#
poke = pokeVkData#
instance VulkanMarshalPrim VkViewport where
unsafeAddr (VkViewport# a _) = a
unsafeByteArray (VkViewport# _ b) = b
unsafeFromByteArrayOffset off b
= VkViewport# (plusAddr# (byteArrayContents# b) off) b
instance VulkanMarshal VkViewport where
type StructFields VkViewport =
'["x", "y", "width", "height", "minDepth", "maxDepth"]
type CUnionType VkViewport = 'False
type ReturnedOnly VkViewport = 'False
type StructExtends VkViewport = '[]
instance HasField "x" VkViewport where
type FieldType "x" VkViewport = Float
type FieldOptional "x" VkViewport = 'False
type FieldOffset "x" VkViewport =
(0)
type FieldIsArray "x" VkViewport = 'False
fieldOptional = False
fieldOffset = (0)
instance CanReadField "x" VkViewport where
getField x
= unsafeDupablePerformIO
(peekByteOff (unsafePtr x) (0))
readField p = peekByteOff p (0)
instance CanWriteField "x" VkViewport where
writeField p = pokeByteOff p (0)
instance HasField "y" VkViewport where
type FieldType "y" VkViewport = Float
type FieldOptional "y" VkViewport = 'False
type FieldOffset "y" VkViewport =
(4)
type FieldIsArray "y" VkViewport = 'False
fieldOptional = False
fieldOffset = (4)
instance CanReadField "y" VkViewport where
getField x
= unsafeDupablePerformIO
(peekByteOff (unsafePtr x) (4))
readField p = peekByteOff p (4)
instance CanWriteField "y" VkViewport where
writeField p = pokeByteOff p (4)
instance HasField "width" VkViewport where
type FieldType "width" VkViewport = Float
type FieldOptional "width" VkViewport = 'False
type FieldOffset "width" VkViewport =
(8)
type FieldIsArray "width" VkViewport = 'False
fieldOptional = False
fieldOffset = (8)
instance CanReadField "width" VkViewport where
getField x
= unsafeDupablePerformIO
(peekByteOff (unsafePtr x) (8))
readField p = peekByteOff p (8)
instance CanWriteField "width" VkViewport where
writeField p
= pokeByteOff p (8)
instance HasField "height" VkViewport where
type FieldType "height" VkViewport = Float
type FieldOptional "height" VkViewport = 'False
type FieldOffset "height" VkViewport =
(12)
type FieldIsArray "height" VkViewport = 'False
fieldOptional = False
fieldOffset = (12)
instance CanReadField "height" VkViewport where
getField x
= unsafeDupablePerformIO
(peekByteOff (unsafePtr x) (12))
readField p
= peekByteOff p (12)
instance CanWriteField "height" VkViewport
where
writeField p
= pokeByteOff p (12)
instance HasField "minDepth" VkViewport where
type FieldType "minDepth" VkViewport = Float
type FieldOptional "minDepth" VkViewport = 'False
type FieldOffset "minDepth" VkViewport =
(16)
type FieldIsArray "minDepth" VkViewport = 'False
fieldOptional = False
fieldOffset = (16)
instance CanReadField "minDepth" VkViewport
where
getField x
= unsafeDupablePerformIO
(peekByteOff (unsafePtr x) (16))
readField p
= peekByteOff p (16)
instance CanWriteField "minDepth" VkViewport
where
writeField p
= pokeByteOff p (16)
instance HasField "maxDepth" VkViewport where
type FieldType "maxDepth" VkViewport = Float
type FieldOptional "maxDepth" VkViewport = 'False
type FieldOffset "maxDepth" VkViewport =
(20)
type FieldIsArray "maxDepth" VkViewport = 'False
fieldOptional = False
fieldOffset = (20)
instance CanReadField "maxDepth" VkViewport
where
getField x
= unsafeDupablePerformIO
(peekByteOff (unsafePtr x) (20))
readField p
= peekByteOff p (20)
instance CanWriteField "maxDepth" VkViewport
where
writeField p
= pokeByteOff p (20)
instance Show VkViewport where
showsPrec d x
= showString "VkViewport {" .
showString "x = " .
showsPrec d (getField @"x" x) .
showString ", " .
showString "y = " .
showsPrec d (getField @"y" x) .
showString ", " .
showString "width = " .
showsPrec d (getField @"width" x) .
showString ", " .
showString "height = " .
showsPrec d (getField @"height" x) .
showString ", " .
showString "minDepth = " .
showsPrec d (getField @"minDepth" x) .
showString ", " .
showString "maxDepth = " .
showsPrec d (getField @"maxDepth" x) . showChar '}'
data VkViewportSwizzleNV = VkViewportSwizzleNV# Addr# ByteArray#
instance Eq VkViewportSwizzleNV where
(VkViewportSwizzleNV# a _) == x@(VkViewportSwizzleNV# b _)
= EQ == cmpBytes# (sizeOf x) a b
instance Ord VkViewportSwizzleNV where
(VkViewportSwizzleNV# a _) `compare` x@(VkViewportSwizzleNV# b _)
= cmpBytes# (sizeOf x) a b
instance Storable VkViewportSwizzleNV where
sizeOf ~_ = (16)
alignment ~_ = (4)
peek = peekVkData#
poke = pokeVkData#
instance VulkanMarshalPrim VkViewportSwizzleNV where
unsafeAddr (VkViewportSwizzleNV# a _) = a
unsafeByteArray (VkViewportSwizzleNV# _ b) = b
unsafeFromByteArrayOffset off b
= VkViewportSwizzleNV# (plusAddr# (byteArrayContents# b) off) b
instance VulkanMarshal VkViewportSwizzleNV where
type StructFields VkViewportSwizzleNV = '["x", "y", "z", "w"]
type CUnionType VkViewportSwizzleNV = 'False
type ReturnedOnly VkViewportSwizzleNV = 'False
type StructExtends VkViewportSwizzleNV = '[]
instance HasField "x" VkViewportSwizzleNV where
type FieldType "x" VkViewportSwizzleNV =
VkViewportCoordinateSwizzleNV
type FieldOptional "x" VkViewportSwizzleNV = 'False
type FieldOffset "x" VkViewportSwizzleNV =
(0)
type FieldIsArray "x" VkViewportSwizzleNV = 'False
fieldOptional = False
fieldOffset = (0)
instance CanReadField "x" VkViewportSwizzleNV
where
getField x
= unsafeDupablePerformIO
(peekByteOff (unsafePtr x) (0))
readField p
= peekByteOff p (0)
instance CanWriteField "x" VkViewportSwizzleNV
where
writeField p
= pokeByteOff p (0)
instance HasField "y" VkViewportSwizzleNV where
type FieldType "y" VkViewportSwizzleNV =
VkViewportCoordinateSwizzleNV
type FieldOptional "y" VkViewportSwizzleNV = 'False
type FieldOffset "y" VkViewportSwizzleNV =
(4)
type FieldIsArray "y" VkViewportSwizzleNV = 'False
fieldOptional = False
fieldOffset = (4)
instance CanReadField "y" VkViewportSwizzleNV
where
getField x
= unsafeDupablePerformIO
(peekByteOff (unsafePtr x) (4))
readField p
= peekByteOff p (4)
instance CanWriteField "y" VkViewportSwizzleNV
where
writeField p
= pokeByteOff p (4)
instance HasField "z" VkViewportSwizzleNV where
type FieldType "z" VkViewportSwizzleNV =
VkViewportCoordinateSwizzleNV
type FieldOptional "z" VkViewportSwizzleNV = 'False
type FieldOffset "z" VkViewportSwizzleNV =
(8)
type FieldIsArray "z" VkViewportSwizzleNV = 'False
fieldOptional = False
fieldOffset = (8)
instance CanReadField "z" VkViewportSwizzleNV
where
getField x
= unsafeDupablePerformIO
(peekByteOff (unsafePtr x) (8))
readField p
= peekByteOff p (8)
instance CanWriteField "z" VkViewportSwizzleNV
where
writeField p
= pokeByteOff p (8)
instance HasField "w" VkViewportSwizzleNV where
type FieldType "w" VkViewportSwizzleNV =
VkViewportCoordinateSwizzleNV
type FieldOptional "w" VkViewportSwizzleNV = 'False
type FieldOffset "w" VkViewportSwizzleNV =
(12)
type FieldIsArray "w" VkViewportSwizzleNV = 'False
fieldOptional = False
fieldOffset = (12)
instance CanReadField "w" VkViewportSwizzleNV
where
getField x
= unsafeDupablePerformIO
(peekByteOff (unsafePtr x) (12))
readField p
= peekByteOff p (12)
instance CanWriteField "w" VkViewportSwizzleNV
where
writeField p
= pokeByteOff p (12)
instance Show VkViewportSwizzleNV where
showsPrec d x
= showString "VkViewportSwizzleNV {" .
showString "x = " .
showsPrec d (getField @"x" x) .
showString ", " .
showString "y = " .
showsPrec d (getField @"y" x) .
showString ", " .
showString "z = " .
showsPrec d (getField @"z" x) .
showString ", " .
showString "w = " . showsPrec d (getField @"w" x) . showChar '}'
data VkViewportWScalingNV = VkViewportWScalingNV# Addr# ByteArray#
instance Eq VkViewportWScalingNV where
(VkViewportWScalingNV# a _) == x@(VkViewportWScalingNV# b _)
= EQ == cmpBytes# (sizeOf x) a b
instance Ord VkViewportWScalingNV where
(VkViewportWScalingNV# a _) `compare` x@(VkViewportWScalingNV# b _)
= cmpBytes# (sizeOf x) a b
instance Storable VkViewportWScalingNV where
sizeOf ~_ = (8)
alignment ~_ = (4)
peek = peekVkData#
poke = pokeVkData#
instance VulkanMarshalPrim VkViewportWScalingNV where
unsafeAddr (VkViewportWScalingNV# a _) = a
unsafeByteArray (VkViewportWScalingNV# _ b) = b
unsafeFromByteArrayOffset off b
= VkViewportWScalingNV# (plusAddr# (byteArrayContents# b) off) b
instance VulkanMarshal VkViewportWScalingNV where
type StructFields VkViewportWScalingNV = '["xcoeff", "ycoeff"]
type CUnionType VkViewportWScalingNV = 'False
type ReturnedOnly VkViewportWScalingNV = 'False
type StructExtends VkViewportWScalingNV = '[]
instance HasField "xcoeff" VkViewportWScalingNV
where
type FieldType "xcoeff" VkViewportWScalingNV =
Float
type FieldOptional "xcoeff" VkViewportWScalingNV = 'False
type FieldOffset "xcoeff" VkViewportWScalingNV =
(0)
type FieldIsArray "xcoeff" VkViewportWScalingNV = 'False
fieldOptional = False
fieldOffset = (0)
instance
CanReadField "xcoeff" VkViewportWScalingNV where
getField x
= unsafeDupablePerformIO
(peekByteOff (unsafePtr x) (0))
readField p
= peekByteOff p (0)
instance
CanWriteField "xcoeff" VkViewportWScalingNV where
writeField p
= pokeByteOff p (0)
instance HasField "ycoeff" VkViewportWScalingNV
where
type FieldType "ycoeff" VkViewportWScalingNV =
Float
type FieldOptional "ycoeff" VkViewportWScalingNV = 'False
type FieldOffset "ycoeff" VkViewportWScalingNV =
(4)
type FieldIsArray "ycoeff" VkViewportWScalingNV = 'False
fieldOptional = False
fieldOffset = (4)
instance
CanReadField "ycoeff" VkViewportWScalingNV where
getField x
= unsafeDupablePerformIO
(peekByteOff (unsafePtr x) (4))
readField p
= peekByteOff p (4)
instance
CanWriteField "ycoeff" VkViewportWScalingNV where
writeField p
= pokeByteOff p (4)
instance Show VkViewportWScalingNV where
showsPrec d x
= showString "VkViewportWScalingNV {" .
showString "xcoeff = " .
showsPrec d (getField @"xcoeff" x) .
showString ", " .
showString "ycoeff = " .
showsPrec d (getField @"ycoeff" x) . showChar '}'