{-# LINE 1 "src/WGPU/Raw/Generated/Struct/WGPUSwapChainDescriptor.hsc" #-}
{-# OPTIONS_GHC -Wno-unused-imports #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE NoImplicitPrelude #-}
module WGPU.Raw.Generated.Struct.WGPUSwapChainDescriptor where
import Data.Word (Word16, Word32, Word64)
import Data.Int (Int32)
import Foreign
import Foreign.C.Types
import WGPU.Raw.Types
import Prelude (pure, ($!))
import WGPU.Raw.Generated.Enum.WGPUTextureFormat
import WGPU.Raw.Generated.Enum.WGPUPresentMode
import WGPU.Raw.Generated.Struct.WGPUChainedStruct
data WGPUSwapChainDescriptor = WGPUSwapChainDescriptor {
WGPUSwapChainDescriptor -> Ptr WGPUChainedStruct
nextInChain :: Ptr (WGPUChainedStruct),
WGPUSwapChainDescriptor -> Ptr CChar
label :: Ptr (CChar),
WGPUSwapChainDescriptor -> WGPUTextureUsageFlags
usage :: WGPUTextureUsageFlags,
WGPUSwapChainDescriptor -> WGPUTextureFormat
format :: WGPUTextureFormat,
WGPUSwapChainDescriptor -> WGPUTextureUsageFlags
width :: Word32,
WGPUSwapChainDescriptor -> WGPUTextureUsageFlags
height :: Word32,
WGPUSwapChainDescriptor -> WGPUPresentMode
presentMode :: WGPUPresentMode
}
instance Storable WGPUSwapChainDescriptor where
sizeOf :: WGPUSwapChainDescriptor -> Int
sizeOf WGPUSwapChainDescriptor
_ = ((Int
40))
{-# LINE 36 "src/WGPU/Raw/Generated/Struct/WGPUSwapChainDescriptor.hsc" #-}
alignment = sizeOf
peek :: Ptr WGPUSwapChainDescriptor -> IO WGPUSwapChainDescriptor
peek Ptr WGPUSwapChainDescriptor
ptr = do
Ptr WGPUChainedStruct
nextInChain <- ((\Ptr WGPUSwapChainDescriptor
hsc_ptr -> Ptr WGPUSwapChainDescriptor -> Int -> IO (Ptr WGPUChainedStruct)
forall a b. Storable a => Ptr b -> Int -> IO a
peekByteOff Ptr WGPUSwapChainDescriptor
hsc_ptr Int
0)) Ptr WGPUSwapChainDescriptor
ptr
{-# LINE 39 "src/WGPU/Raw/Generated/Struct/WGPUSwapChainDescriptor.hsc" #-}
label <- ((\hsc_ptr -> peekByteOff hsc_ptr 8)) ptr
{-# LINE 40 "src/WGPU/Raw/Generated/Struct/WGPUSwapChainDescriptor.hsc" #-}
usage <- ((\hsc_ptr -> peekByteOff hsc_ptr 16)) ptr
{-# LINE 41 "src/WGPU/Raw/Generated/Struct/WGPUSwapChainDescriptor.hsc" #-}
format <- ((\hsc_ptr -> peekByteOff hsc_ptr 20)) ptr
{-# LINE 42 "src/WGPU/Raw/Generated/Struct/WGPUSwapChainDescriptor.hsc" #-}
width <- ((\hsc_ptr -> peekByteOff hsc_ptr 24)) ptr
{-# LINE 43 "src/WGPU/Raw/Generated/Struct/WGPUSwapChainDescriptor.hsc" #-}
height <- ((\hsc_ptr -> peekByteOff hsc_ptr 28)) ptr
{-# LINE 44 "src/WGPU/Raw/Generated/Struct/WGPUSwapChainDescriptor.hsc" #-}
presentMode <- ((\hsc_ptr -> peekByteOff hsc_ptr 32)) ptr
{-# LINE 45 "src/WGPU/Raw/Generated/Struct/WGPUSwapChainDescriptor.hsc" #-}
pure $! WGPUSwapChainDescriptor{..}
poke :: Ptr WGPUSwapChainDescriptor -> WGPUSwapChainDescriptor -> IO ()
poke Ptr WGPUSwapChainDescriptor
ptr WGPUSwapChainDescriptor{WGPUTextureUsageFlags
Ptr CChar
Ptr WGPUChainedStruct
WGPUPresentMode
WGPUTextureFormat
presentMode :: WGPUPresentMode
height :: WGPUTextureUsageFlags
width :: WGPUTextureUsageFlags
format :: WGPUTextureFormat
usage :: WGPUTextureUsageFlags
label :: Ptr CChar
nextInChain :: Ptr WGPUChainedStruct
presentMode :: WGPUSwapChainDescriptor -> WGPUPresentMode
height :: WGPUSwapChainDescriptor -> WGPUTextureUsageFlags
width :: WGPUSwapChainDescriptor -> WGPUTextureUsageFlags
format :: WGPUSwapChainDescriptor -> WGPUTextureFormat
usage :: WGPUSwapChainDescriptor -> WGPUTextureUsageFlags
label :: WGPUSwapChainDescriptor -> Ptr CChar
nextInChain :: WGPUSwapChainDescriptor -> Ptr WGPUChainedStruct
..} = do
((\Ptr WGPUSwapChainDescriptor
hsc_ptr -> Ptr WGPUSwapChainDescriptor
-> Int -> Ptr WGPUChainedStruct -> IO ()
forall a b. Storable a => Ptr b -> Int -> a -> IO ()
pokeByteOff Ptr WGPUSwapChainDescriptor
hsc_ptr Int
0)) Ptr WGPUSwapChainDescriptor
ptr Ptr WGPUChainedStruct
nextInChain
{-# LINE 48 "src/WGPU/Raw/Generated/Struct/WGPUSwapChainDescriptor.hsc" #-}
((\hsc_ptr -> pokeByteOff hsc_ptr 8)) ptr label
{-# LINE 49 "src/WGPU/Raw/Generated/Struct/WGPUSwapChainDescriptor.hsc" #-}
((\hsc_ptr -> pokeByteOff hsc_ptr 16)) ptr usage
{-# LINE 50 "src/WGPU/Raw/Generated/Struct/WGPUSwapChainDescriptor.hsc" #-}
((\hsc_ptr -> pokeByteOff hsc_ptr 20)) ptr format
{-# LINE 51 "src/WGPU/Raw/Generated/Struct/WGPUSwapChainDescriptor.hsc" #-}
((\hsc_ptr -> pokeByteOff hsc_ptr 24)) ptr width
{-# LINE 52 "src/WGPU/Raw/Generated/Struct/WGPUSwapChainDescriptor.hsc" #-}
((\hsc_ptr -> pokeByteOff hsc_ptr 28)) ptr height
{-# LINE 53 "src/WGPU/Raw/Generated/Struct/WGPUSwapChainDescriptor.hsc" #-}
((\hsc_ptr -> pokeByteOff hsc_ptr 32)) ptr presentMode