ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/GPURenderPassDescriptor.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.GPURenderPassDescriptor
(js_newGPURenderPassDescriptor, js_setColorAttachments, js_getColorAttachments, js_setDepthStencilAttachment, js_getDepthStencilAttachment, js_setOcclusionQuerySet, js_getOcclusionQuerySet, js_setTimestampWrites, js_getTimestampWrites, js_setMaxDrawCount, js_getMaxDrawCount, newGPURenderPassDescriptor, setColorAttachments, getColorAttachments, setDepthStencilAttachment, getDepthStencilAttachment, getDepthStencilAttachmentUnsafe, getDepthStencilAttachmentUnchecked, setOcclusionQuerySet, getOcclusionQuerySet, getOcclusionQuerySetUnsafe, getOcclusionQuerySetUnchecked, setTimestampWrites, getTimestampWrites, getTimestampWritesUnsafe, getTimestampWritesUnchecked, setMaxDrawCount, getMaxDrawCount, getMaxDrawCountUnsafe, getMaxDrawCountUnchecked, GPURenderPassDescriptor(..), gTypeGPURenderPassDescriptor)
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 ({\"colorAttachments\": $1}); })"
js_newGPURenderPassDescriptor :: JSVal -> IO GPURenderPassDescriptor
-- | <https://gpuweb.github.io/gpuweb/#dictdef-gpurenderpassdescriptor GPURenderPassDescriptor specification>
newGPURenderPassDescriptor :: (MonadDOM m) => [Maybe GPURenderPassColorAttachment] -> m GPURenderPassDescriptor
newGPURenderPassDescriptor colorAttachments = liftDOM (((toJSVal colorAttachments) >>= \a1' -> js_newGPURenderPassDescriptor a1'))
foreign import javascript safe "(($1, $2) => { $1[\"colorAttachments\"] = $2; })"
js_setColorAttachments :: GPURenderPassDescriptor -> JSVal -> IO ()
-- | <https://gpuweb.github.io/gpuweb/#dom-gpurenderpassdescriptor-colorattachments GPURenderPassDescriptor.colorAttachments specification>
setColorAttachments :: (MonadDOM m) => GPURenderPassDescriptor -> [Maybe GPURenderPassColorAttachment] -> m ()
setColorAttachments self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setColorAttachments (self) a2')))
foreign import javascript unsafe "(($1) => { return $1[\"colorAttachments\"]; })"
js_getColorAttachments :: GPURenderPassDescriptor -> IO JSVal
-- | <https://gpuweb.github.io/gpuweb/#dom-gpurenderpassdescriptor-colorattachments GPURenderPassDescriptor.colorAttachments specification>
getColorAttachments :: (MonadDOM m) => GPURenderPassDescriptor -> m [Maybe GPURenderPassColorAttachment]
getColorAttachments self = liftDOM (((js_getColorAttachments (self)) >>= fromJSValUnchecked))
foreign import javascript safe "(($1, $2) => { $1[\"depthStencilAttachment\"] = $2; })"
js_setDepthStencilAttachment :: GPURenderPassDescriptor -> GPURenderPassDepthStencilAttachment -> IO ()
-- | <https://gpuweb.github.io/gpuweb/#dom-gpurenderpassdescriptor-depthstencilattachment GPURenderPassDescriptor.depthStencilAttachment specification>
setDepthStencilAttachment :: (MonadDOM m) => GPURenderPassDescriptor -> GPURenderPassDepthStencilAttachment -> m ()
setDepthStencilAttachment self val = liftDOM (void ((js_setDepthStencilAttachment (self) (val))))
foreign import javascript unsafe "(($1) => { return $1[\"depthStencilAttachment\"]; })"
js_getDepthStencilAttachment :: GPURenderPassDescriptor -> IO JSVal
-- | <https://gpuweb.github.io/gpuweb/#dom-gpurenderpassdescriptor-depthstencilattachment GPURenderPassDescriptor.depthStencilAttachment specification>
getDepthStencilAttachment :: (MonadDOM m) => GPURenderPassDescriptor -> m (Maybe GPURenderPassDepthStencilAttachment)
getDepthStencilAttachment self = liftDOM (((js_getDepthStencilAttachment (self)) >>= fromJSValUnchecked))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpurenderpassdescriptor-depthstencilattachment GPURenderPassDescriptor.depthStencilAttachment specification>
getDepthStencilAttachmentUnsafe :: (MonadDOM m, HasCallStack) => GPURenderPassDescriptor -> m GPURenderPassDepthStencilAttachment
getDepthStencilAttachmentUnsafe self = liftDOM ((((js_getDepthStencilAttachment (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpurenderpassdescriptor-depthstencilattachment GPURenderPassDescriptor.depthStencilAttachment specification>
getDepthStencilAttachmentUnchecked :: (MonadDOM m) => GPURenderPassDescriptor -> m GPURenderPassDepthStencilAttachment
getDepthStencilAttachmentUnchecked self = liftDOM ((pFromJSVal <$> (js_getDepthStencilAttachment (self))))
foreign import javascript safe "(($1, $2) => { $1[\"occlusionQuerySet\"] = $2; })"
js_setOcclusionQuerySet :: GPURenderPassDescriptor -> GPUQuerySet -> IO ()
-- | <https://gpuweb.github.io/gpuweb/#dom-gpurenderpassdescriptor-occlusionqueryset GPURenderPassDescriptor.occlusionQuerySet specification>
setOcclusionQuerySet :: (MonadDOM m) => GPURenderPassDescriptor -> GPUQuerySet -> m ()
setOcclusionQuerySet self val = liftDOM (void ((js_setOcclusionQuerySet (self) (val))))
foreign import javascript unsafe "(($1) => { return $1[\"occlusionQuerySet\"]; })"
js_getOcclusionQuerySet :: GPURenderPassDescriptor -> IO JSVal
-- | <https://gpuweb.github.io/gpuweb/#dom-gpurenderpassdescriptor-occlusionqueryset GPURenderPassDescriptor.occlusionQuerySet specification>
getOcclusionQuerySet :: (MonadDOM m) => GPURenderPassDescriptor -> m (Maybe GPUQuerySet)
getOcclusionQuerySet self = liftDOM (((js_getOcclusionQuerySet (self)) >>= fromJSValUnchecked))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpurenderpassdescriptor-occlusionqueryset GPURenderPassDescriptor.occlusionQuerySet specification>
getOcclusionQuerySetUnsafe :: (MonadDOM m, HasCallStack) => GPURenderPassDescriptor -> m GPUQuerySet
getOcclusionQuerySetUnsafe self = liftDOM ((((js_getOcclusionQuerySet (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpurenderpassdescriptor-occlusionqueryset GPURenderPassDescriptor.occlusionQuerySet specification>
getOcclusionQuerySetUnchecked :: (MonadDOM m) => GPURenderPassDescriptor -> m GPUQuerySet
getOcclusionQuerySetUnchecked self = liftDOM ((pFromJSVal <$> (js_getOcclusionQuerySet (self))))
foreign import javascript safe "(($1, $2) => { $1[\"timestampWrites\"] = $2; })"
js_setTimestampWrites :: GPURenderPassDescriptor -> GPURenderPassTimestampWrites -> IO ()
-- | <https://gpuweb.github.io/gpuweb/#dom-gpurenderpassdescriptor-timestampwrites GPURenderPassDescriptor.timestampWrites specification>
setTimestampWrites :: (MonadDOM m) => GPURenderPassDescriptor -> GPURenderPassTimestampWrites -> m ()
setTimestampWrites self val = liftDOM (void ((js_setTimestampWrites (self) (val))))
foreign import javascript unsafe "(($1) => { return $1[\"timestampWrites\"]; })"
js_getTimestampWrites :: GPURenderPassDescriptor -> IO JSVal
-- | <https://gpuweb.github.io/gpuweb/#dom-gpurenderpassdescriptor-timestampwrites GPURenderPassDescriptor.timestampWrites specification>
getTimestampWrites :: (MonadDOM m) => GPURenderPassDescriptor -> m (Maybe GPURenderPassTimestampWrites)
getTimestampWrites self = liftDOM (((js_getTimestampWrites (self)) >>= fromJSValUnchecked))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpurenderpassdescriptor-timestampwrites GPURenderPassDescriptor.timestampWrites specification>
getTimestampWritesUnsafe :: (MonadDOM m, HasCallStack) => GPURenderPassDescriptor -> m GPURenderPassTimestampWrites
getTimestampWritesUnsafe self = liftDOM ((((js_getTimestampWrites (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpurenderpassdescriptor-timestampwrites GPURenderPassDescriptor.timestampWrites specification>
getTimestampWritesUnchecked :: (MonadDOM m) => GPURenderPassDescriptor -> m GPURenderPassTimestampWrites
getTimestampWritesUnchecked self = liftDOM ((pFromJSVal <$> (js_getTimestampWrites (self))))
foreign import javascript safe "(($1, $2) => { $1[\"maxDrawCount\"] = $2; })"
js_setMaxDrawCount :: GPURenderPassDescriptor -> JSVal -> IO ()
-- | <https://gpuweb.github.io/gpuweb/#dom-gpurenderpassdescriptor-maxdrawcount GPURenderPassDescriptor.maxDrawCount specification>
setMaxDrawCount :: (MonadDOM m) => GPURenderPassDescriptor -> Word53 -> m ()
setMaxDrawCount self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setMaxDrawCount (self) a2')))
foreign import javascript unsafe "(($1) => { return $1[\"maxDrawCount\"]; })"
js_getMaxDrawCount :: GPURenderPassDescriptor -> IO JSVal
-- | <https://gpuweb.github.io/gpuweb/#dom-gpurenderpassdescriptor-maxdrawcount GPURenderPassDescriptor.maxDrawCount specification>
getMaxDrawCount :: (MonadDOM m) => GPURenderPassDescriptor -> m (Maybe Word53)
getMaxDrawCount self = liftDOM (((js_getMaxDrawCount (self)) >>= fromJSValUnchecked))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpurenderpassdescriptor-maxdrawcount GPURenderPassDescriptor.maxDrawCount specification>
getMaxDrawCountUnsafe :: (MonadDOM m, HasCallStack) => GPURenderPassDescriptor -> m Word53
getMaxDrawCountUnsafe self = liftDOM ((((js_getMaxDrawCount (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpurenderpassdescriptor-maxdrawcount GPURenderPassDescriptor.maxDrawCount specification>
getMaxDrawCountUnchecked :: (MonadDOM m) => GPURenderPassDescriptor -> m Word53
getMaxDrawCountUnchecked self = liftDOM ((pFromJSVal <$> (js_getMaxDrawCount (self))))