wgpu-raw-hs-0.3.0.0: src/WGPU/Raw/Generated/Struct/WGPUSamplerDescriptor.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.WGPUSamplerDescriptor 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.WGPUAddressMode
import WGPU.Raw.Generated.Enum.WGPUAddressMode
import WGPU.Raw.Generated.Enum.WGPUAddressMode
import WGPU.Raw.Generated.Enum.WGPUFilterMode
import WGPU.Raw.Generated.Enum.WGPUFilterMode
import WGPU.Raw.Generated.Enum.WGPUFilterMode
import WGPU.Raw.Generated.Enum.WGPUCompareFunction
import WGPU.Raw.Generated.Struct.WGPUChainedStruct
data WGPUSamplerDescriptor = WGPUSamplerDescriptor {
nextInChain :: Ptr (WGPUChainedStruct),
label :: Ptr (CChar),
addressModeU :: WGPUAddressMode,
addressModeV :: WGPUAddressMode,
addressModeW :: WGPUAddressMode,
magFilter :: WGPUFilterMode,
minFilter :: WGPUFilterMode,
mipmapFilter :: WGPUFilterMode,
lodMinClamp :: CFloat,
lodMaxClamp :: CFloat,
compare :: WGPUCompareFunction,
maxAnisotropy :: Word16
}
instance Storable WGPUSamplerDescriptor where
sizeOf _ = (#size WGPUSamplerDescriptor)
{-# INLINABLE sizeOf #-}
alignment = sizeOf
{-# INLINABLE alignment #-}
peek ptr = do
nextInChain <- (#peek WGPUSamplerDescriptor, nextInChain) ptr
label <- (#peek WGPUSamplerDescriptor, label) ptr
addressModeU <- (#peek WGPUSamplerDescriptor, addressModeU) ptr
addressModeV <- (#peek WGPUSamplerDescriptor, addressModeV) ptr
addressModeW <- (#peek WGPUSamplerDescriptor, addressModeW) ptr
magFilter <- (#peek WGPUSamplerDescriptor, magFilter) ptr
minFilter <- (#peek WGPUSamplerDescriptor, minFilter) ptr
mipmapFilter <- (#peek WGPUSamplerDescriptor, mipmapFilter) ptr
lodMinClamp <- (#peek WGPUSamplerDescriptor, lodMinClamp) ptr
lodMaxClamp <- (#peek WGPUSamplerDescriptor, lodMaxClamp) ptr
compare <- (#peek WGPUSamplerDescriptor, compare) ptr
maxAnisotropy <- (#peek WGPUSamplerDescriptor, maxAnisotropy) ptr
pure $! WGPUSamplerDescriptor{..}
{-# INLINABLE peek #-}
poke ptr WGPUSamplerDescriptor{..} = do
(#poke WGPUSamplerDescriptor, nextInChain) ptr nextInChain
(#poke WGPUSamplerDescriptor, label) ptr label
(#poke WGPUSamplerDescriptor, addressModeU) ptr addressModeU
(#poke WGPUSamplerDescriptor, addressModeV) ptr addressModeV
(#poke WGPUSamplerDescriptor, addressModeW) ptr addressModeW
(#poke WGPUSamplerDescriptor, magFilter) ptr magFilter
(#poke WGPUSamplerDescriptor, minFilter) ptr minFilter
(#poke WGPUSamplerDescriptor, mipmapFilter) ptr mipmapFilter
(#poke WGPUSamplerDescriptor, lodMinClamp) ptr lodMinClamp
(#poke WGPUSamplerDescriptor, lodMaxClamp) ptr lodMaxClamp
(#poke WGPUSamplerDescriptor, compare) ptr compare
(#poke WGPUSamplerDescriptor, maxAnisotropy) ptr maxAnisotropy
{-# INLINABLE poke #-}