packages feed

ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/GPURenderPassLayout.hs

{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ForeignFunctionInterface, JavaScriptFFI #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from webgpu (webref). Do not edit.
module GHCJS.DOM.JSFFI.Generated.GPURenderPassLayout
       (js_newGPURenderPassLayout, js_setColorFormats, js_getColorFormats, js_setDepthStencilFormat, js_getDepthStencilFormat, js_setSampleCount, js_getSampleCount, 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 GHCJS.Types (JSVal, JSString)
import GHCJS.Foreign (jsUndefined, jsNull)
import GHCJS.DOM.Types
import qualified GHCJS.DOM.Types as Types
import GHCJS.DOM.EventTargetClosures (EventName, unsafeEventName, unsafeEventNameAsync)
import GHCJS.DOM.JSFFI.Generated.Enums

foreign import javascript safe "(($1) => { return ({\"colorFormats\": $1}); })"
        js_newGPURenderPassLayout :: JSVal -> IO GPURenderPassLayout
-- | <https://gpuweb.github.io/gpuweb/#dictdef-gpurenderpasslayout GPURenderPassLayout specification>
newGPURenderPassLayout :: (MonadDOM m) => [Maybe GPUTextureFormat] -> m GPURenderPassLayout
newGPURenderPassLayout colorFormats = liftDOM (((toJSVal colorFormats) >>= \a1' -> js_newGPURenderPassLayout a1'))

foreign import javascript safe "(($1, $2) => { $1[\"colorFormats\"] = $2; })"
        js_setColorFormats :: GPURenderPassLayout -> JSVal -> IO ()
-- | <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 (((toJSVal val) >>= \a2' -> js_setColorFormats ((Types.toGPURenderPassLayout self)) a2')))

foreign import javascript unsafe "(($1) => { return $1[\"colorFormats\"]; })"
        js_getColorFormats :: GPURenderPassLayout -> IO JSVal
-- | <https://gpuweb.github.io/gpuweb/#dom-gpurenderpasslayout-colorformats GPURenderPassLayout.colorFormats specification>
getColorFormats :: (MonadDOM m, IsGPURenderPassLayout self) => self -> m [Maybe GPUTextureFormat]
getColorFormats self = liftDOM (((js_getColorFormats ((Types.toGPURenderPassLayout self))) >>= fromJSValUnchecked))

foreign import javascript safe "(($1, $2) => { $1[\"depthStencilFormat\"] = $2; })"
        js_setDepthStencilFormat :: GPURenderPassLayout -> JSVal -> IO ()
-- | <https://gpuweb.github.io/gpuweb/#dom-gpurenderpasslayout-depthstencilformat GPURenderPassLayout.depthStencilFormat specification>
setDepthStencilFormat :: (MonadDOM m, IsGPURenderPassLayout self) => self -> GPUTextureFormat -> m ()
setDepthStencilFormat self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setDepthStencilFormat ((Types.toGPURenderPassLayout self)) a2')))

foreign import javascript unsafe "(($1) => { return $1[\"depthStencilFormat\"]; })"
        js_getDepthStencilFormat :: GPURenderPassLayout -> IO JSVal
-- | <https://gpuweb.github.io/gpuweb/#dom-gpurenderpasslayout-depthstencilformat GPURenderPassLayout.depthStencilFormat specification>
getDepthStencilFormat :: (MonadDOM m, IsGPURenderPassLayout self) => self -> m (Maybe GPUTextureFormat)
getDepthStencilFormat self = liftDOM (((js_getDepthStencilFormat ((Types.toGPURenderPassLayout self))) >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpurenderpasslayout-depthstencilformat GPURenderPassLayout.depthStencilFormat specification>
getDepthStencilFormatUnsafe :: (MonadDOM m, IsGPURenderPassLayout self, HasCallStack) => self -> m GPUTextureFormat
getDepthStencilFormatUnsafe self = liftDOM ((((js_getDepthStencilFormat ((Types.toGPURenderPassLayout self))) >>= 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 ((pFromJSVal <$> (js_getDepthStencilFormat ((Types.toGPURenderPassLayout self)))))

foreign import javascript safe "(($1, $2) => { $1[\"sampleCount\"] = $2; })"
        js_setSampleCount :: GPURenderPassLayout -> Word -> IO ()
-- | <https://gpuweb.github.io/gpuweb/#dom-gpurenderpasslayout-samplecount GPURenderPassLayout.sampleCount specification>
setSampleCount :: (MonadDOM m, IsGPURenderPassLayout self) => self -> Word -> m ()
setSampleCount self val = liftDOM (void ((js_setSampleCount ((Types.toGPURenderPassLayout self)) (val))))

foreign import javascript unsafe "(($1) => { return $1[\"sampleCount\"]; })"
        js_getSampleCount :: GPURenderPassLayout -> IO JSVal
-- | <https://gpuweb.github.io/gpuweb/#dom-gpurenderpasslayout-samplecount GPURenderPassLayout.sampleCount specification>
getSampleCount :: (MonadDOM m, IsGPURenderPassLayout self) => self -> m (Maybe Word)
getSampleCount self = liftDOM (((js_getSampleCount ((Types.toGPURenderPassLayout self))) >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpurenderpasslayout-samplecount GPURenderPassLayout.sampleCount specification>
getSampleCountUnsafe :: (MonadDOM m, IsGPURenderPassLayout self, HasCallStack) => self -> m Word
getSampleCountUnsafe self = liftDOM ((((js_getSampleCount ((Types.toGPURenderPassLayout self))) >>= 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 ((pFromJSVal <$> (js_getSampleCount ((Types.toGPURenderPassLayout self)))))