packages feed

jsaddle-dom-0.10.0.0: src/JSDOM/Generated/GPURenderPassDescriptor.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.GPURenderPassDescriptor
       (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 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-gpurenderpassdescriptor GPURenderPassDescriptor specification>
newGPURenderPassDescriptor :: (MonadDOM m) => [Maybe GPURenderPassColorAttachment] -> m GPURenderPassDescriptor
newGPURenderPassDescriptor colorAttachments = liftDOM ((((new (jsg "Object") () >>= \o -> (o ^. jss "colorAttachments" (toJSVal colorAttachments)) P.>> P.return o)) >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpurenderpassdescriptor-colorattachments GPURenderPassDescriptor.colorAttachments specification>
setColorAttachments :: (MonadDOM m) => GPURenderPassDescriptor -> [Maybe GPURenderPassColorAttachment] -> m ()
setColorAttachments self val = liftDOM (void (self ^. jss "colorAttachments" (toJSVal val)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpurenderpassdescriptor-colorattachments GPURenderPassDescriptor.colorAttachments specification>
getColorAttachments :: (MonadDOM m) => GPURenderPassDescriptor -> m [Maybe GPURenderPassColorAttachment]
getColorAttachments self = liftDOM (((self ^. js "colorAttachments") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpurenderpassdescriptor-depthstencilattachment GPURenderPassDescriptor.depthStencilAttachment specification>
setDepthStencilAttachment :: (MonadDOM m) => GPURenderPassDescriptor -> GPURenderPassDepthStencilAttachment -> m ()
setDepthStencilAttachment self val = liftDOM (void (self ^. jss "depthStencilAttachment" (toJSVal val)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpurenderpassdescriptor-depthstencilattachment GPURenderPassDescriptor.depthStencilAttachment specification>
getDepthStencilAttachment :: (MonadDOM m) => GPURenderPassDescriptor -> m (Maybe GPURenderPassDepthStencilAttachment)
getDepthStencilAttachment self = liftDOM (((self ^. js "depthStencilAttachment") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpurenderpassdescriptor-depthstencilattachment GPURenderPassDescriptor.depthStencilAttachment specification>
getDepthStencilAttachmentUnsafe :: (MonadDOM m, HasCallStack) => GPURenderPassDescriptor -> m GPURenderPassDepthStencilAttachment
getDepthStencilAttachmentUnsafe self = liftDOM ((((self ^. js "depthStencilAttachment") >>= 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 (((self ^. js "depthStencilAttachment") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpurenderpassdescriptor-occlusionqueryset GPURenderPassDescriptor.occlusionQuerySet specification>
setOcclusionQuerySet :: (MonadDOM m) => GPURenderPassDescriptor -> GPUQuerySet -> m ()
setOcclusionQuerySet self val = liftDOM (void (self ^. jss "occlusionQuerySet" (toJSVal val)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpurenderpassdescriptor-occlusionqueryset GPURenderPassDescriptor.occlusionQuerySet specification>
getOcclusionQuerySet :: (MonadDOM m) => GPURenderPassDescriptor -> m (Maybe GPUQuerySet)
getOcclusionQuerySet self = liftDOM (((self ^. js "occlusionQuerySet") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpurenderpassdescriptor-occlusionqueryset GPURenderPassDescriptor.occlusionQuerySet specification>
getOcclusionQuerySetUnsafe :: (MonadDOM m, HasCallStack) => GPURenderPassDescriptor -> m GPUQuerySet
getOcclusionQuerySetUnsafe self = liftDOM ((((self ^. js "occlusionQuerySet") >>= 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 (((self ^. js "occlusionQuerySet") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpurenderpassdescriptor-timestampwrites GPURenderPassDescriptor.timestampWrites specification>
setTimestampWrites :: (MonadDOM m) => GPURenderPassDescriptor -> GPURenderPassTimestampWrites -> m ()
setTimestampWrites self val = liftDOM (void (self ^. jss "timestampWrites" (toJSVal val)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpurenderpassdescriptor-timestampwrites GPURenderPassDescriptor.timestampWrites specification>
getTimestampWrites :: (MonadDOM m) => GPURenderPassDescriptor -> m (Maybe GPURenderPassTimestampWrites)
getTimestampWrites self = liftDOM (((self ^. js "timestampWrites") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpurenderpassdescriptor-timestampwrites GPURenderPassDescriptor.timestampWrites specification>
getTimestampWritesUnsafe :: (MonadDOM m, HasCallStack) => GPURenderPassDescriptor -> m GPURenderPassTimestampWrites
getTimestampWritesUnsafe self = liftDOM ((((self ^. js "timestampWrites") >>= 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 (((self ^. js "timestampWrites") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpurenderpassdescriptor-maxdrawcount GPURenderPassDescriptor.maxDrawCount specification>
setMaxDrawCount :: (MonadDOM m) => GPURenderPassDescriptor -> Word53 -> m ()
setMaxDrawCount self val = liftDOM (void (self ^. jss "maxDrawCount" (toJSVal val)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpurenderpassdescriptor-maxdrawcount GPURenderPassDescriptor.maxDrawCount specification>
getMaxDrawCount :: (MonadDOM m) => GPURenderPassDescriptor -> m (Maybe Word53)
getMaxDrawCount self = liftDOM (((self ^. js "maxDrawCount") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpurenderpassdescriptor-maxdrawcount GPURenderPassDescriptor.maxDrawCount specification>
getMaxDrawCountUnsafe :: (MonadDOM m, HasCallStack) => GPURenderPassDescriptor -> m Word53
getMaxDrawCountUnsafe self = liftDOM ((((self ^. js "maxDrawCount") >>= 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 (((self ^. js "maxDrawCount") >>= fromJSValUnchecked))