{-# LINE 1 "src/WGPU/Raw/Generated/Struct/WGPUColor.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.WGPUColor where



import Data.Word (Word16, Word32, Word64)
import Data.Int (Int32)
import Foreign
import Foreign.C.Types
import WGPU.Raw.Types
import Prelude (pure, ($!))


data WGPUColor = WGPUColor {
  WGPUColor -> CDouble
r :: CDouble,
  WGPUColor -> CDouble
g :: CDouble,
  WGPUColor -> CDouble
b :: CDouble,
  WGPUColor -> CDouble
a :: CDouble
}

instance Storable WGPUColor where
  sizeOf :: WGPUColor -> Int
sizeOf WGPUColor
_ = ((Int
32))
{-# LINE 31 "src/WGPU/Raw/Generated/Struct/WGPUColor.hsc" #-}
  {-# INLINABLE sizeOf #-}
  alignment :: WGPUColor -> Int
alignment = WGPUColor -> Int
forall a. Storable a => a -> Int
sizeOf
  {-# INLINABLE alignment #-}
  peek :: Ptr WGPUColor -> IO WGPUColor
peek Ptr WGPUColor
ptr = do
    CDouble
r <- ((\Ptr WGPUColor
hsc_ptr -> Ptr WGPUColor -> Int -> IO CDouble
forall a b. Storable a => Ptr b -> Int -> IO a
peekByteOff Ptr WGPUColor
hsc_ptr Int
0)) Ptr WGPUColor
ptr
{-# LINE 36 "src/WGPU/Raw/Generated/Struct/WGPUColor.hsc" #-}
    g <- ((\hsc_ptr -> peekByteOff hsc_ptr 8)) ptr
{-# LINE 37 "src/WGPU/Raw/Generated/Struct/WGPUColor.hsc" #-}
    b <- ((\hsc_ptr -> peekByteOff hsc_ptr 16)) ptr
{-# LINE 38 "src/WGPU/Raw/Generated/Struct/WGPUColor.hsc" #-}
    a <- ((\hsc_ptr -> peekByteOff hsc_ptr 24)) ptr
{-# LINE 39 "src/WGPU/Raw/Generated/Struct/WGPUColor.hsc" #-}
    pure $! WGPUColor{..}
  {-# INLINABLE peek #-}
  poke :: Ptr WGPUColor -> WGPUColor -> IO ()
poke Ptr WGPUColor
ptr WGPUColor{CDouble
a :: CDouble
b :: CDouble
g :: CDouble
r :: CDouble
a :: WGPUColor -> CDouble
b :: WGPUColor -> CDouble
g :: WGPUColor -> CDouble
r :: WGPUColor -> CDouble
..} = do
    ((\Ptr WGPUColor
hsc_ptr -> Ptr WGPUColor -> Int -> CDouble -> IO ()
forall a b. Storable a => Ptr b -> Int -> a -> IO ()
pokeByteOff Ptr WGPUColor
hsc_ptr Int
0)) Ptr WGPUColor
ptr CDouble
r
{-# LINE 43 "src/WGPU/Raw/Generated/Struct/WGPUColor.hsc" #-}
    ((\hsc_ptr -> pokeByteOff hsc_ptr 8)) ptr g
{-# LINE 44 "src/WGPU/Raw/Generated/Struct/WGPUColor.hsc" #-}
    ((\hsc_ptr -> pokeByteOff hsc_ptr 16)) ptr b
{-# LINE 45 "src/WGPU/Raw/Generated/Struct/WGPUColor.hsc" #-}
    ((\hsc_ptr -> pokeByteOff hsc_ptr 24)) ptr a
{-# LINE 46 "src/WGPU/Raw/Generated/Struct/WGPUColor.hsc" #-}
  {-# INLINABLE poke #-}