packages feed

jsaddle-dom-0.10.0.0: src/JSDOM/Generated/GPUDepthStencilState.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.GPUDepthStencilState
       (newGPUDepthStencilState, setFormat, getFormat, setDepthWriteEnabled, getDepthWriteEnabled, getDepthWriteEnabledUnsafe, getDepthWriteEnabledUnchecked, setDepthCompare, getDepthCompare, getDepthCompareUnsafe, getDepthCompareUnchecked, setStencilFront, getStencilFront, getStencilFrontUnsafe, getStencilFrontUnchecked, setStencilBack, getStencilBack, getStencilBackUnsafe, getStencilBackUnchecked, setStencilReadMask, getStencilReadMask, getStencilReadMaskUnsafe, getStencilReadMaskUnchecked, setStencilWriteMask, getStencilWriteMask, getStencilWriteMaskUnsafe, getStencilWriteMaskUnchecked, setDepthBias, getDepthBias, getDepthBiasUnsafe, getDepthBiasUnchecked, setDepthBiasSlopeScale, getDepthBiasSlopeScale, getDepthBiasSlopeScaleUnsafe, getDepthBiasSlopeScaleUnchecked, setDepthBiasClamp, getDepthBiasClamp, getDepthBiasClampUnsafe, getDepthBiasClampUnchecked, GPUDepthStencilState(..), gTypeGPUDepthStencilState)
       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-gpudepthstencilstate GPUDepthStencilState specification>
newGPUDepthStencilState :: (MonadDOM m) => GPUTextureFormat -> m GPUDepthStencilState
newGPUDepthStencilState format = liftDOM ((((new (jsg "Object") () >>= \o -> (o ^. jss "format" (toJSVal format)) P.>> P.return o)) >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpudepthstencilstate-format GPUDepthStencilState.format specification>
setFormat :: (MonadDOM m) => GPUDepthStencilState -> GPUTextureFormat -> m ()
setFormat self val = liftDOM (void (self ^. jss "format" (toJSVal val)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpudepthstencilstate-format GPUDepthStencilState.format specification>
getFormat :: (MonadDOM m) => GPUDepthStencilState -> m GPUTextureFormat
getFormat self = liftDOM (((self ^. js "format") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpudepthstencilstate-depthwriteenabled GPUDepthStencilState.depthWriteEnabled specification>
setDepthWriteEnabled :: (MonadDOM m) => GPUDepthStencilState -> Bool -> m ()
setDepthWriteEnabled self val = liftDOM (void (self ^. jss "depthWriteEnabled" (toJSVal val)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpudepthstencilstate-depthwriteenabled GPUDepthStencilState.depthWriteEnabled specification>
getDepthWriteEnabled :: (MonadDOM m) => GPUDepthStencilState -> m (Maybe Bool)
getDepthWriteEnabled self = liftDOM (((self ^. js "depthWriteEnabled") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpudepthstencilstate-depthwriteenabled GPUDepthStencilState.depthWriteEnabled specification>
getDepthWriteEnabledUnsafe :: (MonadDOM m, HasCallStack) => GPUDepthStencilState -> m Bool
getDepthWriteEnabledUnsafe self = liftDOM ((((self ^. js "depthWriteEnabled") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpudepthstencilstate-depthwriteenabled GPUDepthStencilState.depthWriteEnabled specification>
getDepthWriteEnabledUnchecked :: (MonadDOM m) => GPUDepthStencilState -> m Bool
getDepthWriteEnabledUnchecked self = liftDOM (((self ^. js "depthWriteEnabled") >>= valToBool))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpudepthstencilstate-depthcompare GPUDepthStencilState.depthCompare specification>
setDepthCompare :: (MonadDOM m) => GPUDepthStencilState -> GPUCompareFunction -> m ()
setDepthCompare self val = liftDOM (void (self ^. jss "depthCompare" (toJSVal val)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpudepthstencilstate-depthcompare GPUDepthStencilState.depthCompare specification>
getDepthCompare :: (MonadDOM m) => GPUDepthStencilState -> m (Maybe GPUCompareFunction)
getDepthCompare self = liftDOM (((self ^. js "depthCompare") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpudepthstencilstate-depthcompare GPUDepthStencilState.depthCompare specification>
getDepthCompareUnsafe :: (MonadDOM m, HasCallStack) => GPUDepthStencilState -> m GPUCompareFunction
getDepthCompareUnsafe self = liftDOM ((((self ^. js "depthCompare") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpudepthstencilstate-depthcompare GPUDepthStencilState.depthCompare specification>
getDepthCompareUnchecked :: (MonadDOM m) => GPUDepthStencilState -> m GPUCompareFunction
getDepthCompareUnchecked self = liftDOM (((self ^. js "depthCompare") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpudepthstencilstate-stencilfront GPUDepthStencilState.stencilFront specification>
setStencilFront :: (MonadDOM m) => GPUDepthStencilState -> GPUStencilFaceState -> m ()
setStencilFront self val = liftDOM (void (self ^. jss "stencilFront" (toJSVal val)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpudepthstencilstate-stencilfront GPUDepthStencilState.stencilFront specification>
getStencilFront :: (MonadDOM m) => GPUDepthStencilState -> m (Maybe GPUStencilFaceState)
getStencilFront self = liftDOM (((self ^. js "stencilFront") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpudepthstencilstate-stencilfront GPUDepthStencilState.stencilFront specification>
getStencilFrontUnsafe :: (MonadDOM m, HasCallStack) => GPUDepthStencilState -> m GPUStencilFaceState
getStencilFrontUnsafe self = liftDOM ((((self ^. js "stencilFront") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpudepthstencilstate-stencilfront GPUDepthStencilState.stencilFront specification>
getStencilFrontUnchecked :: (MonadDOM m) => GPUDepthStencilState -> m GPUStencilFaceState
getStencilFrontUnchecked self = liftDOM (((self ^. js "stencilFront") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpudepthstencilstate-stencilback GPUDepthStencilState.stencilBack specification>
setStencilBack :: (MonadDOM m) => GPUDepthStencilState -> GPUStencilFaceState -> m ()
setStencilBack self val = liftDOM (void (self ^. jss "stencilBack" (toJSVal val)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpudepthstencilstate-stencilback GPUDepthStencilState.stencilBack specification>
getStencilBack :: (MonadDOM m) => GPUDepthStencilState -> m (Maybe GPUStencilFaceState)
getStencilBack self = liftDOM (((self ^. js "stencilBack") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpudepthstencilstate-stencilback GPUDepthStencilState.stencilBack specification>
getStencilBackUnsafe :: (MonadDOM m, HasCallStack) => GPUDepthStencilState -> m GPUStencilFaceState
getStencilBackUnsafe self = liftDOM ((((self ^. js "stencilBack") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpudepthstencilstate-stencilback GPUDepthStencilState.stencilBack specification>
getStencilBackUnchecked :: (MonadDOM m) => GPUDepthStencilState -> m GPUStencilFaceState
getStencilBackUnchecked self = liftDOM (((self ^. js "stencilBack") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpudepthstencilstate-stencilreadmask GPUDepthStencilState.stencilReadMask specification>
setStencilReadMask :: (MonadDOM m) => GPUDepthStencilState -> Word -> m ()
setStencilReadMask self val = liftDOM (void (self ^. jss "stencilReadMask" (toJSVal val)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpudepthstencilstate-stencilreadmask GPUDepthStencilState.stencilReadMask specification>
getStencilReadMask :: (MonadDOM m) => GPUDepthStencilState -> m (Maybe Word)
getStencilReadMask self = liftDOM (((self ^. js "stencilReadMask") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpudepthstencilstate-stencilreadmask GPUDepthStencilState.stencilReadMask specification>
getStencilReadMaskUnsafe :: (MonadDOM m, HasCallStack) => GPUDepthStencilState -> m Word
getStencilReadMaskUnsafe self = liftDOM ((((self ^. js "stencilReadMask") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpudepthstencilstate-stencilreadmask GPUDepthStencilState.stencilReadMask specification>
getStencilReadMaskUnchecked :: (MonadDOM m) => GPUDepthStencilState -> m Word
getStencilReadMaskUnchecked self = liftDOM ((P.round <$> ((self ^. js "stencilReadMask") >>= valToNumber)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpudepthstencilstate-stencilwritemask GPUDepthStencilState.stencilWriteMask specification>
setStencilWriteMask :: (MonadDOM m) => GPUDepthStencilState -> Word -> m ()
setStencilWriteMask self val = liftDOM (void (self ^. jss "stencilWriteMask" (toJSVal val)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpudepthstencilstate-stencilwritemask GPUDepthStencilState.stencilWriteMask specification>
getStencilWriteMask :: (MonadDOM m) => GPUDepthStencilState -> m (Maybe Word)
getStencilWriteMask self = liftDOM (((self ^. js "stencilWriteMask") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpudepthstencilstate-stencilwritemask GPUDepthStencilState.stencilWriteMask specification>
getStencilWriteMaskUnsafe :: (MonadDOM m, HasCallStack) => GPUDepthStencilState -> m Word
getStencilWriteMaskUnsafe self = liftDOM ((((self ^. js "stencilWriteMask") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpudepthstencilstate-stencilwritemask GPUDepthStencilState.stencilWriteMask specification>
getStencilWriteMaskUnchecked :: (MonadDOM m) => GPUDepthStencilState -> m Word
getStencilWriteMaskUnchecked self = liftDOM ((P.round <$> ((self ^. js "stencilWriteMask") >>= valToNumber)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpudepthstencilstate-depthbias GPUDepthStencilState.depthBias specification>
setDepthBias :: (MonadDOM m) => GPUDepthStencilState -> Int -> m ()
setDepthBias self val = liftDOM (void (self ^. jss "depthBias" (toJSVal val)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpudepthstencilstate-depthbias GPUDepthStencilState.depthBias specification>
getDepthBias :: (MonadDOM m) => GPUDepthStencilState -> m (Maybe Int)
getDepthBias self = liftDOM (((self ^. js "depthBias") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpudepthstencilstate-depthbias GPUDepthStencilState.depthBias specification>
getDepthBiasUnsafe :: (MonadDOM m, HasCallStack) => GPUDepthStencilState -> m Int
getDepthBiasUnsafe self = liftDOM ((((self ^. js "depthBias") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpudepthstencilstate-depthbias GPUDepthStencilState.depthBias specification>
getDepthBiasUnchecked :: (MonadDOM m) => GPUDepthStencilState -> m Int
getDepthBiasUnchecked self = liftDOM ((P.round <$> ((self ^. js "depthBias") >>= valToNumber)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpudepthstencilstate-depthbiasslopescale GPUDepthStencilState.depthBiasSlopeScale specification>
setDepthBiasSlopeScale :: (MonadDOM m) => GPUDepthStencilState -> Float -> m ()
setDepthBiasSlopeScale self val = liftDOM (void (self ^. jss "depthBiasSlopeScale" (toJSVal val)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpudepthstencilstate-depthbiasslopescale GPUDepthStencilState.depthBiasSlopeScale specification>
getDepthBiasSlopeScale :: (MonadDOM m) => GPUDepthStencilState -> m (Maybe Float)
getDepthBiasSlopeScale self = liftDOM (((self ^. js "depthBiasSlopeScale") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpudepthstencilstate-depthbiasslopescale GPUDepthStencilState.depthBiasSlopeScale specification>
getDepthBiasSlopeScaleUnsafe :: (MonadDOM m, HasCallStack) => GPUDepthStencilState -> m Float
getDepthBiasSlopeScaleUnsafe self = liftDOM ((((self ^. js "depthBiasSlopeScale") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpudepthstencilstate-depthbiasslopescale GPUDepthStencilState.depthBiasSlopeScale specification>
getDepthBiasSlopeScaleUnchecked :: (MonadDOM m) => GPUDepthStencilState -> m Float
getDepthBiasSlopeScaleUnchecked self = liftDOM ((P.realToFrac <$> ((self ^. js "depthBiasSlopeScale") >>= valToNumber)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpudepthstencilstate-depthbiasclamp GPUDepthStencilState.depthBiasClamp specification>
setDepthBiasClamp :: (MonadDOM m) => GPUDepthStencilState -> Float -> m ()
setDepthBiasClamp self val = liftDOM (void (self ^. jss "depthBiasClamp" (toJSVal val)))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpudepthstencilstate-depthbiasclamp GPUDepthStencilState.depthBiasClamp specification>
getDepthBiasClamp :: (MonadDOM m) => GPUDepthStencilState -> m (Maybe Float)
getDepthBiasClamp self = liftDOM (((self ^. js "depthBiasClamp") >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpudepthstencilstate-depthbiasclamp GPUDepthStencilState.depthBiasClamp specification>
getDepthBiasClampUnsafe :: (MonadDOM m, HasCallStack) => GPUDepthStencilState -> m Float
getDepthBiasClampUnsafe self = liftDOM ((((self ^. js "depthBiasClamp") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpudepthstencilstate-depthbiasclamp GPUDepthStencilState.depthBiasClamp specification>
getDepthBiasClampUnchecked :: (MonadDOM m) => GPUDepthStencilState -> m Float
getDepthBiasClampUnchecked self = liftDOM ((P.realToFrac <$> ((self ^. js "depthBiasClamp") >>= valToNumber)))