{-# LINE 1 "src/WGPU/Raw/Generated/Struct/WGPUImageCopyTexture.hsc" #-}
{-# OPTIONS_GHC -Wno-unused-imports #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE NoImplicitPrelude #-}
module WGPU.Raw.Generated.Struct.WGPUImageCopyTexture 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.WGPUTextureAspect
import WGPU.Raw.Generated.Struct.WGPUChainedStruct
import WGPU.Raw.Generated.Struct.WGPUOrigin3D
data WGPUImageCopyTexture = WGPUImageCopyTexture {
WGPUImageCopyTexture -> Ptr WGPUChainedStruct
nextInChain :: Ptr (WGPUChainedStruct),
WGPUImageCopyTexture -> WGPUTexture
texture :: WGPUTexture,
WGPUImageCopyTexture -> Word32
mipLevel :: Word32,
WGPUImageCopyTexture -> WGPUOrigin3D
origin :: WGPUOrigin3D,
WGPUImageCopyTexture -> WGPUTextureAspect
aspect :: WGPUTextureAspect
}
instance Storable WGPUImageCopyTexture where
sizeOf :: WGPUImageCopyTexture -> Int
sizeOf WGPUImageCopyTexture
_ = ((Int
40))
{-# LINE 34 "src/WGPU/Raw/Generated/Struct/WGPUImageCopyTexture.hsc" #-}
alignment = sizeOf
peek :: Ptr WGPUImageCopyTexture -> IO WGPUImageCopyTexture
peek Ptr WGPUImageCopyTexture
ptr = do
Ptr WGPUChainedStruct
nextInChain <- ((\Ptr WGPUImageCopyTexture
hsc_ptr -> Ptr WGPUImageCopyTexture -> Int -> IO (Ptr WGPUChainedStruct)
forall a b. Storable a => Ptr b -> Int -> IO a
peekByteOff Ptr WGPUImageCopyTexture
hsc_ptr Int
0)) Ptr WGPUImageCopyTexture
ptr
{-# LINE 37 "src/WGPU/Raw/Generated/Struct/WGPUImageCopyTexture.hsc" #-}
texture <- ((\hsc_ptr -> peekByteOff hsc_ptr 8)) ptr
{-# LINE 38 "src/WGPU/Raw/Generated/Struct/WGPUImageCopyTexture.hsc" #-}
mipLevel <- ((\hsc_ptr -> peekByteOff hsc_ptr 16)) ptr
{-# LINE 39 "src/WGPU/Raw/Generated/Struct/WGPUImageCopyTexture.hsc" #-}
origin <- ((\hsc_ptr -> peekByteOff hsc_ptr 20)) ptr
{-# LINE 40 "src/WGPU/Raw/Generated/Struct/WGPUImageCopyTexture.hsc" #-}
aspect <- ((\hsc_ptr -> peekByteOff hsc_ptr 32)) ptr
{-# LINE 41 "src/WGPU/Raw/Generated/Struct/WGPUImageCopyTexture.hsc" #-}
pure $! WGPUImageCopyTexture{..}
poke :: Ptr WGPUImageCopyTexture -> WGPUImageCopyTexture -> IO ()
poke Ptr WGPUImageCopyTexture
ptr WGPUImageCopyTexture{Word32
Ptr WGPUChainedStruct
WGPUTextureAspect
WGPUTexture
WGPUOrigin3D
aspect :: WGPUTextureAspect
origin :: WGPUOrigin3D
mipLevel :: Word32
texture :: WGPUTexture
nextInChain :: Ptr WGPUChainedStruct
aspect :: WGPUImageCopyTexture -> WGPUTextureAspect
origin :: WGPUImageCopyTexture -> WGPUOrigin3D
mipLevel :: WGPUImageCopyTexture -> Word32
texture :: WGPUImageCopyTexture -> WGPUTexture
nextInChain :: WGPUImageCopyTexture -> Ptr WGPUChainedStruct
..} = do
((\Ptr WGPUImageCopyTexture
hsc_ptr -> Ptr WGPUImageCopyTexture -> Int -> Ptr WGPUChainedStruct -> IO ()
forall a b. Storable a => Ptr b -> Int -> a -> IO ()
pokeByteOff Ptr WGPUImageCopyTexture
hsc_ptr Int
0)) Ptr WGPUImageCopyTexture
ptr Ptr WGPUChainedStruct
nextInChain
{-# LINE 44 "src/WGPU/Raw/Generated/Struct/WGPUImageCopyTexture.hsc" #-}
((\hsc_ptr -> pokeByteOff hsc_ptr 8)) ptr texture
{-# LINE 45 "src/WGPU/Raw/Generated/Struct/WGPUImageCopyTexture.hsc" #-}
((\hsc_ptr -> pokeByteOff hsc_ptr 16)) ptr mipLevel
{-# LINE 46 "src/WGPU/Raw/Generated/Struct/WGPUImageCopyTexture.hsc" #-}
((\hsc_ptr -> pokeByteOff hsc_ptr 20)) ptr origin
{-# LINE 47 "src/WGPU/Raw/Generated/Struct/WGPUImageCopyTexture.hsc" #-}
((\hsc_ptr -> pokeByteOff hsc_ptr 32)) ptr aspect