wgpu-raw-hs-0.1.0.0: src/WGPU/Raw/Generated/Struct/WGPUBufferDescriptor.hsc
{-# OPTIONS_GHC -Wno-unused-imports #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE NoImplicitPrelude #-}
-- This file was generated by wgpu-raw-hs-codegen on:
-- 2021-08-15T08:56:06.968390
-- Using wgpu-native git hash:
-- b10496e7eed9349f0fd541e6dfe5029cb436de74 wgpu-native (v0.9.2.2)
module WGPU.Raw.Generated.Struct.WGPUBufferDescriptor 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.Struct.WGPUChainedStruct
data WGPUBufferDescriptor = WGPUBufferDescriptor {
nextInChain :: Ptr (WGPUChainedStruct),
label :: Ptr (CChar),
usage :: WGPUBufferUsageFlags,
size :: Word64,
mappedAtCreation :: CBool
}
instance Storable WGPUBufferDescriptor where
sizeOf _ = (#size WGPUBufferDescriptor)
alignment = sizeOf
peek ptr = do
nextInChain <- (#peek WGPUBufferDescriptor, nextInChain) ptr
label <- (#peek WGPUBufferDescriptor, label) ptr
usage <- (#peek WGPUBufferDescriptor, usage) ptr
size <- (#peek WGPUBufferDescriptor, size) ptr
mappedAtCreation <- (#peek WGPUBufferDescriptor, mappedAtCreation) ptr
pure $! WGPUBufferDescriptor{..}
poke ptr WGPUBufferDescriptor{..} = do
(#poke WGPUBufferDescriptor, nextInChain) ptr nextInChain
(#poke WGPUBufferDescriptor, label) ptr label
(#poke WGPUBufferDescriptor, usage) ptr usage
(#poke WGPUBufferDescriptor, size) ptr size
(#poke WGPUBufferDescriptor, mappedAtCreation) ptr mappedAtCreation