{-# LINE 1 "src/WGPU/Raw/Generated/Struct/WGPUPrimitiveState.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.WGPUPrimitiveState 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.WGPUPrimitiveTopology
import WGPU.Raw.Generated.Enum.WGPUIndexFormat
import WGPU.Raw.Generated.Enum.WGPUFrontFace
import WGPU.Raw.Generated.Enum.WGPUCullMode
import WGPU.Raw.Generated.Struct.WGPUChainedStruct

data WGPUPrimitiveState = WGPUPrimitiveState {
  WGPUPrimitiveState -> Ptr WGPUChainedStruct
nextInChain :: Ptr (WGPUChainedStruct),
  WGPUPrimitiveState -> WGPUPrimitiveTopology
topology :: WGPUPrimitiveTopology,
  WGPUPrimitiveState -> WGPUIndexFormat
stripIndexFormat :: WGPUIndexFormat,
  WGPUPrimitiveState -> WGPUFrontFace
frontFace :: WGPUFrontFace,
  WGPUPrimitiveState -> WGPUCullMode
cullMode :: WGPUCullMode
}

instance Storable WGPUPrimitiveState where
  sizeOf :: WGPUPrimitiveState -> Int
sizeOf WGPUPrimitiveState
_ = ((Int
24))
{-# LINE 36 "src/WGPU/Raw/Generated/Struct/WGPUPrimitiveState.hsc" #-}
  {-# INLINABLE sizeOf #-}
  alignment :: WGPUPrimitiveState -> Int
alignment = WGPUPrimitiveState -> Int
forall a. Storable a => a -> Int
sizeOf
  {-# INLINABLE alignment #-}
  peek :: Ptr WGPUPrimitiveState -> IO WGPUPrimitiveState
peek Ptr WGPUPrimitiveState
ptr = do
    Ptr WGPUChainedStruct
nextInChain <- ((\Ptr WGPUPrimitiveState
hsc_ptr -> Ptr WGPUPrimitiveState -> Int -> IO (Ptr WGPUChainedStruct)
forall a b. Storable a => Ptr b -> Int -> IO a
peekByteOff Ptr WGPUPrimitiveState
hsc_ptr Int
0)) Ptr WGPUPrimitiveState
ptr
{-# LINE 41 "src/WGPU/Raw/Generated/Struct/WGPUPrimitiveState.hsc" #-}
    topology <- ((\hsc_ptr -> peekByteOff hsc_ptr 8)) ptr
{-# LINE 42 "src/WGPU/Raw/Generated/Struct/WGPUPrimitiveState.hsc" #-}
    stripIndexFormat <- ((\hsc_ptr -> peekByteOff hsc_ptr 12)) ptr
{-# LINE 43 "src/WGPU/Raw/Generated/Struct/WGPUPrimitiveState.hsc" #-}
    frontFace <- ((\hsc_ptr -> peekByteOff hsc_ptr 16)) ptr
{-# LINE 44 "src/WGPU/Raw/Generated/Struct/WGPUPrimitiveState.hsc" #-}
    cullMode <- ((\hsc_ptr -> peekByteOff hsc_ptr 20)) ptr
{-# LINE 45 "src/WGPU/Raw/Generated/Struct/WGPUPrimitiveState.hsc" #-}
    pure $! WGPUPrimitiveState{..}
  {-# INLINABLE peek #-}
  poke :: Ptr WGPUPrimitiveState -> WGPUPrimitiveState -> IO ()
poke Ptr WGPUPrimitiveState
ptr WGPUPrimitiveState{Ptr WGPUChainedStruct
WGPUCullMode
WGPUFrontFace
WGPUIndexFormat
WGPUPrimitiveTopology
cullMode :: WGPUCullMode
frontFace :: WGPUFrontFace
stripIndexFormat :: WGPUIndexFormat
topology :: WGPUPrimitiveTopology
nextInChain :: Ptr WGPUChainedStruct
cullMode :: WGPUPrimitiveState -> WGPUCullMode
frontFace :: WGPUPrimitiveState -> WGPUFrontFace
stripIndexFormat :: WGPUPrimitiveState -> WGPUIndexFormat
topology :: WGPUPrimitiveState -> WGPUPrimitiveTopology
nextInChain :: WGPUPrimitiveState -> Ptr WGPUChainedStruct
..} = do
    ((\Ptr WGPUPrimitiveState
hsc_ptr -> Ptr WGPUPrimitiveState -> Int -> Ptr WGPUChainedStruct -> IO ()
forall a b. Storable a => Ptr b -> Int -> a -> IO ()
pokeByteOff Ptr WGPUPrimitiveState
hsc_ptr Int
0)) Ptr WGPUPrimitiveState
ptr Ptr WGPUChainedStruct
nextInChain
{-# LINE 49 "src/WGPU/Raw/Generated/Struct/WGPUPrimitiveState.hsc" #-}
    ((\hsc_ptr -> pokeByteOff hsc_ptr 8)) ptr topology
{-# LINE 50 "src/WGPU/Raw/Generated/Struct/WGPUPrimitiveState.hsc" #-}
    ((\hsc_ptr -> pokeByteOff hsc_ptr 12)) ptr stripIndexFormat
{-# LINE 51 "src/WGPU/Raw/Generated/Struct/WGPUPrimitiveState.hsc" #-}
    ((\hsc_ptr -> pokeByteOff hsc_ptr 16)) ptr frontFace
{-# LINE 52 "src/WGPU/Raw/Generated/Struct/WGPUPrimitiveState.hsc" #-}
    ((\hsc_ptr -> pokeByteOff hsc_ptr 20)) ptr cullMode
{-# LINE 53 "src/WGPU/Raw/Generated/Struct/WGPUPrimitiveState.hsc" #-}
  {-# INLINABLE poke #-}