packages feed

wgpu-raw-hs-0.3.0.0: src/WGPU/Raw/Generated/Struct/WGPUDepthStencilState.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.WGPUDepthStencilState where

#include "wgpu.h"

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.WGPUCompareFunction
import WGPU.Raw.Generated.Struct.WGPUChainedStruct
import WGPU.Raw.Generated.Struct.WGPUStencilFaceState
import WGPU.Raw.Generated.Struct.WGPUStencilFaceState

data WGPUDepthStencilState = WGPUDepthStencilState {
  nextInChain :: Ptr (WGPUChainedStruct),
  format :: WGPUTextureFormat,
  depthWriteEnabled :: CBool,
  depthCompare :: WGPUCompareFunction,
  stencilFront :: WGPUStencilFaceState,
  stencilBack :: WGPUStencilFaceState,
  stencilReadMask :: Word32,
  stencilWriteMask :: Word32,
  depthBias :: Int32,
  depthBiasSlopeScale :: CFloat,
  depthBiasClamp :: CFloat
}

instance Storable WGPUDepthStencilState where
  sizeOf _ = (#size WGPUDepthStencilState)
  {-# INLINABLE sizeOf #-}
  alignment = sizeOf
  {-# INLINABLE alignment #-}
  peek ptr = do
    nextInChain <- (#peek WGPUDepthStencilState, nextInChain) ptr
    format <- (#peek WGPUDepthStencilState, format) ptr
    depthWriteEnabled <- (#peek WGPUDepthStencilState, depthWriteEnabled) ptr
    depthCompare <- (#peek WGPUDepthStencilState, depthCompare) ptr
    stencilFront <- (#peek WGPUDepthStencilState, stencilFront) ptr
    stencilBack <- (#peek WGPUDepthStencilState, stencilBack) ptr
    stencilReadMask <- (#peek WGPUDepthStencilState, stencilReadMask) ptr
    stencilWriteMask <- (#peek WGPUDepthStencilState, stencilWriteMask) ptr
    depthBias <- (#peek WGPUDepthStencilState, depthBias) ptr
    depthBiasSlopeScale <- (#peek WGPUDepthStencilState, depthBiasSlopeScale) ptr
    depthBiasClamp <- (#peek WGPUDepthStencilState, depthBiasClamp) ptr
    pure $! WGPUDepthStencilState{..}
  {-# INLINABLE peek #-}
  poke ptr WGPUDepthStencilState{..} = do
    (#poke WGPUDepthStencilState, nextInChain) ptr nextInChain
    (#poke WGPUDepthStencilState, format) ptr format
    (#poke WGPUDepthStencilState, depthWriteEnabled) ptr depthWriteEnabled
    (#poke WGPUDepthStencilState, depthCompare) ptr depthCompare
    (#poke WGPUDepthStencilState, stencilFront) ptr stencilFront
    (#poke WGPUDepthStencilState, stencilBack) ptr stencilBack
    (#poke WGPUDepthStencilState, stencilReadMask) ptr stencilReadMask
    (#poke WGPUDepthStencilState, stencilWriteMask) ptr stencilWriteMask
    (#poke WGPUDepthStencilState, depthBias) ptr depthBias
    (#poke WGPUDepthStencilState, depthBiasSlopeScale) ptr depthBiasSlopeScale
    (#poke WGPUDepthStencilState, depthBiasClamp) ptr depthBiasClamp
  {-# INLINABLE poke #-}