jsaddle-dom-0.10.0.0: src/JSDOM/Generated/GPURenderPassLayout.hs
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from webgpu (webref). Do not edit.
module JSDOM.Generated.GPURenderPassLayout
(newGPURenderPassLayout, setColorFormats, getColorFormats, setDepthStencilFormat, getDepthStencilFormat, getDepthStencilFormatUnsafe, getDepthStencilFormatUnchecked, setSampleCount, getSampleCount, getSampleCountUnsafe, getSampleCountUnchecked, GPURenderPassLayout(..), gTypeGPURenderPassLayout, IsGPURenderPassLayout, toGPURenderPassLayout)
where
import Prelude ((.), (==), (>>=), (<$>), (++), Bool(..), Maybe(..), IO, Int, Word, Double, Float)
import qualified Prelude as P
import Control.Monad (void)
import Control.Lens.Operators ((^.))
import Language.Javascript.JSaddle (JSM, JSVal, JSString, toJSVal, valToBool, valToNumber, js, jss, jsf, jsg, new, function, asyncFunction, jsUndefined, jsNull)
import JSDOM.Types
import qualified JSDOM.Types as Types
import JSDOM.EventTargetClosures (EventName, unsafeEventName, unsafeEventNameAsync)
import JSDOM.Generated.Enums
-- | <https://gpuweb.github.io/gpuweb/#dictdef-gpurenderpasslayout GPURenderPassLayout specification>
newGPURenderPassLayout :: (MonadDOM m) => [Maybe GPUTextureFormat] -> m GPURenderPassLayout
newGPURenderPassLayout colorFormats = liftDOM ((((new (jsg "Object") () >>= \o -> (o ^. jss "colorFormats" (toJSVal colorFormats)) P.>> P.return o)) >>= fromJSValUnchecked))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpurenderpasslayout-colorformats GPURenderPassLayout.colorFormats specification>
setColorFormats :: (MonadDOM m, IsGPURenderPassLayout self) => self -> [Maybe GPUTextureFormat] -> m ()
setColorFormats self val = liftDOM (void ((Types.toGPURenderPassLayout self) ^. jss "colorFormats" (toJSVal val)))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpurenderpasslayout-colorformats GPURenderPassLayout.colorFormats specification>
getColorFormats :: (MonadDOM m, IsGPURenderPassLayout self) => self -> m [Maybe GPUTextureFormat]
getColorFormats self = liftDOM ((((Types.toGPURenderPassLayout self) ^. js "colorFormats") >>= fromJSValUnchecked))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpurenderpasslayout-depthstencilformat GPURenderPassLayout.depthStencilFormat specification>
setDepthStencilFormat :: (MonadDOM m, IsGPURenderPassLayout self) => self -> GPUTextureFormat -> m ()
setDepthStencilFormat self val = liftDOM (void ((Types.toGPURenderPassLayout self) ^. jss "depthStencilFormat" (toJSVal val)))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpurenderpasslayout-depthstencilformat GPURenderPassLayout.depthStencilFormat specification>
getDepthStencilFormat :: (MonadDOM m, IsGPURenderPassLayout self) => self -> m (Maybe GPUTextureFormat)
getDepthStencilFormat self = liftDOM ((((Types.toGPURenderPassLayout self) ^. js "depthStencilFormat") >>= fromJSValUnchecked))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpurenderpasslayout-depthstencilformat GPURenderPassLayout.depthStencilFormat specification>
getDepthStencilFormatUnsafe :: (MonadDOM m, IsGPURenderPassLayout self, HasCallStack) => self -> m GPUTextureFormat
getDepthStencilFormatUnsafe self = liftDOM (((((Types.toGPURenderPassLayout self) ^. js "depthStencilFormat") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpurenderpasslayout-depthstencilformat GPURenderPassLayout.depthStencilFormat specification>
getDepthStencilFormatUnchecked :: (MonadDOM m, IsGPURenderPassLayout self) => self -> m GPUTextureFormat
getDepthStencilFormatUnchecked self = liftDOM ((((Types.toGPURenderPassLayout self) ^. js "depthStencilFormat") >>= fromJSValUnchecked))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpurenderpasslayout-samplecount GPURenderPassLayout.sampleCount specification>
setSampleCount :: (MonadDOM m, IsGPURenderPassLayout self) => self -> Word -> m ()
setSampleCount self val = liftDOM (void ((Types.toGPURenderPassLayout self) ^. jss "sampleCount" (toJSVal val)))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpurenderpasslayout-samplecount GPURenderPassLayout.sampleCount specification>
getSampleCount :: (MonadDOM m, IsGPURenderPassLayout self) => self -> m (Maybe Word)
getSampleCount self = liftDOM ((((Types.toGPURenderPassLayout self) ^. js "sampleCount") >>= fromJSValUnchecked))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpurenderpasslayout-samplecount GPURenderPassLayout.sampleCount specification>
getSampleCountUnsafe :: (MonadDOM m, IsGPURenderPassLayout self, HasCallStack) => self -> m Word
getSampleCountUnsafe self = liftDOM (((((Types.toGPURenderPassLayout self) ^. js "sampleCount") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpurenderpasslayout-samplecount GPURenderPassLayout.sampleCount specification>
getSampleCountUnchecked :: (MonadDOM m, IsGPURenderPassLayout self) => self -> m Word
getSampleCountUnchecked self = liftDOM ((P.round <$> (((Types.toGPURenderPassLayout self) ^. js "sampleCount") >>= valToNumber)))