{-# LINE 1 "src/WGPU/Raw/Generated/Struct/WGPUSwapChainDescriptor.hsc" #-}
{-# OPTIONS_GHC -Wno-unused-imports #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE NoImplicitPrelude #-}

-- This file was generated by wgpu-raw-hs-codegen on:
--   2021-08-25T10:02:03.522705
-- Using wgpu-native git hash:
--   b10496e7eed9349f0fd541e6dfe5029cb436de74 wgpu-native (v0.9.2.2)

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" #-}
  {-# INLINABLE sizeOf #-}
  alignment :: WGPUSwapChainDescriptor -> Int
alignment = WGPUSwapChainDescriptor -> Int
forall a. Storable a => a -> Int
sizeOf
  {-# INLINABLE alignment #-}
  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 41 "src/WGPU/Raw/Generated/Struct/WGPUSwapChainDescriptor.hsc" #-}
    label <- ((\hsc_ptr -> peekByteOff hsc_ptr 8)) ptr
{-# LINE 42 "src/WGPU/Raw/Generated/Struct/WGPUSwapChainDescriptor.hsc" #-}
    usage <- ((\hsc_ptr -> peekByteOff hsc_ptr 16)) ptr
{-# LINE 43 "src/WGPU/Raw/Generated/Struct/WGPUSwapChainDescriptor.hsc" #-}
    format <- ((\hsc_ptr -> peekByteOff hsc_ptr 20)) ptr
{-# LINE 44 "src/WGPU/Raw/Generated/Struct/WGPUSwapChainDescriptor.hsc" #-}
    width <- ((\hsc_ptr -> peekByteOff hsc_ptr 24)) ptr
{-# LINE 45 "src/WGPU/Raw/Generated/Struct/WGPUSwapChainDescriptor.hsc" #-}
    height <- ((\hsc_ptr -> peekByteOff hsc_ptr 28)) ptr
{-# LINE 46 "src/WGPU/Raw/Generated/Struct/WGPUSwapChainDescriptor.hsc" #-}
    presentMode <- ((\hsc_ptr -> peekByteOff hsc_ptr 32)) ptr
{-# LINE 47 "src/WGPU/Raw/Generated/Struct/WGPUSwapChainDescriptor.hsc" #-}
    pure $! WGPUSwapChainDescriptor{..}
  {-# INLINABLE peek #-}
  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 51 "src/WGPU/Raw/Generated/Struct/WGPUSwapChainDescriptor.hsc" #-}
    ((\hsc_ptr -> pokeByteOff hsc_ptr 8)) ptr label
{-# LINE 52 "src/WGPU/Raw/Generated/Struct/WGPUSwapChainDescriptor.hsc" #-}
    ((\hsc_ptr -> pokeByteOff hsc_ptr 16)) ptr usage
{-# LINE 53 "src/WGPU/Raw/Generated/Struct/WGPUSwapChainDescriptor.hsc" #-}
    ((\hsc_ptr -> pokeByteOff hsc_ptr 20)) ptr format
{-# LINE 54 "src/WGPU/Raw/Generated/Struct/WGPUSwapChainDescriptor.hsc" #-}
    ((\hsc_ptr -> pokeByteOff hsc_ptr 24)) ptr width
{-# LINE 55 "src/WGPU/Raw/Generated/Struct/WGPUSwapChainDescriptor.hsc" #-}
    ((\hsc_ptr -> pokeByteOff hsc_ptr 28)) ptr height
{-# LINE 56 "src/WGPU/Raw/Generated/Struct/WGPUSwapChainDescriptor.hsc" #-}
    ((\hsc_ptr -> pokeByteOff hsc_ptr 32)) ptr presentMode
{-# LINE 57 "src/WGPU/Raw/Generated/Struct/WGPUSwapChainDescriptor.hsc" #-}
  {-# INLINABLE poke #-}