{-# LINE 1 "src/WGPU/Raw/Generated/Struct/WGPUColorTargetState.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.WGPUColorTargetState 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.Struct.WGPUChainedStruct
import WGPU.Raw.Generated.Struct.WGPUBlendState

data WGPUColorTargetState = WGPUColorTargetState {
  WGPUColorTargetState -> Ptr WGPUChainedStruct
nextInChain :: Ptr (WGPUChainedStruct),
  WGPUColorTargetState -> WGPUTextureFormat
format :: WGPUTextureFormat,
  WGPUColorTargetState -> Ptr WGPUBlendState
blend :: Ptr (WGPUBlendState),
  WGPUColorTargetState -> WGPUColorWriteMaskFlags
writeMask :: WGPUColorWriteMaskFlags
}

instance Storable WGPUColorTargetState where
  sizeOf :: WGPUColorTargetState -> Int
sizeOf WGPUColorTargetState
_ = ((Int
32))
{-# LINE 33 "src/WGPU/Raw/Generated/Struct/WGPUColorTargetState.hsc" #-}
  {-# INLINABLE sizeOf #-}
  alignment :: WGPUColorTargetState -> Int
alignment = WGPUColorTargetState -> Int
forall a. Storable a => a -> Int
sizeOf
  {-# INLINABLE alignment #-}
  peek :: Ptr WGPUColorTargetState -> IO WGPUColorTargetState
peek Ptr WGPUColorTargetState
ptr = do
    Ptr WGPUChainedStruct
nextInChain <- ((\Ptr WGPUColorTargetState
hsc_ptr -> Ptr WGPUColorTargetState -> Int -> IO (Ptr WGPUChainedStruct)
forall a b. Storable a => Ptr b -> Int -> IO a
peekByteOff Ptr WGPUColorTargetState
hsc_ptr Int
0)) Ptr WGPUColorTargetState
ptr
{-# LINE 38 "src/WGPU/Raw/Generated/Struct/WGPUColorTargetState.hsc" #-}
    format <- ((\hsc_ptr -> peekByteOff hsc_ptr 8)) ptr
{-# LINE 39 "src/WGPU/Raw/Generated/Struct/WGPUColorTargetState.hsc" #-}
    blend <- ((\hsc_ptr -> peekByteOff hsc_ptr 16)) ptr
{-# LINE 40 "src/WGPU/Raw/Generated/Struct/WGPUColorTargetState.hsc" #-}
    writeMask <- ((\hsc_ptr -> peekByteOff hsc_ptr 24)) ptr
{-# LINE 41 "src/WGPU/Raw/Generated/Struct/WGPUColorTargetState.hsc" #-}
    pure $! WGPUColorTargetState{..}
  {-# INLINABLE peek #-}
  poke :: Ptr WGPUColorTargetState -> WGPUColorTargetState -> IO ()
poke Ptr WGPUColorTargetState
ptr WGPUColorTargetState{WGPUColorWriteMaskFlags
Ptr WGPUChainedStruct
Ptr WGPUBlendState
WGPUTextureFormat
writeMask :: WGPUColorWriteMaskFlags
blend :: Ptr WGPUBlendState
format :: WGPUTextureFormat
nextInChain :: Ptr WGPUChainedStruct
writeMask :: WGPUColorTargetState -> WGPUColorWriteMaskFlags
blend :: WGPUColorTargetState -> Ptr WGPUBlendState
format :: WGPUColorTargetState -> WGPUTextureFormat
nextInChain :: WGPUColorTargetState -> Ptr WGPUChainedStruct
..} = do
    ((\Ptr WGPUColorTargetState
hsc_ptr -> Ptr WGPUColorTargetState -> Int -> Ptr WGPUChainedStruct -> IO ()
forall a b. Storable a => Ptr b -> Int -> a -> IO ()
pokeByteOff Ptr WGPUColorTargetState
hsc_ptr Int
0)) Ptr WGPUColorTargetState
ptr Ptr WGPUChainedStruct
nextInChain
{-# LINE 45 "src/WGPU/Raw/Generated/Struct/WGPUColorTargetState.hsc" #-}
    ((\hsc_ptr -> pokeByteOff hsc_ptr 8)) ptr format
{-# LINE 46 "src/WGPU/Raw/Generated/Struct/WGPUColorTargetState.hsc" #-}
    ((\hsc_ptr -> pokeByteOff hsc_ptr 16)) ptr blend
{-# LINE 47 "src/WGPU/Raw/Generated/Struct/WGPUColorTargetState.hsc" #-}
    ((\hsc_ptr -> pokeByteOff hsc_ptr 24)) ptr writeMask
{-# LINE 48 "src/WGPU/Raw/Generated/Struct/WGPUColorTargetState.hsc" #-}
  {-# INLINABLE poke #-}