ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/GPUVertexAttribute.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.GPUVertexAttribute
(js_newGPUVertexAttribute, js_setFormat, js_getFormat, js_setOffset, js_getOffset, js_setShaderLocation, js_getShaderLocation, newGPUVertexAttribute, setFormat, getFormat, setOffset, getOffset, setShaderLocation, getShaderLocation, GPUVertexAttribute(..), gTypeGPUVertexAttribute)
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, $2, $3) => { return ({\"format\": $1, \"offset\": $2, \"shaderLocation\": $3}); })"
js_newGPUVertexAttribute :: JSVal -> JSVal -> Word -> IO GPUVertexAttribute
-- | <https://gpuweb.github.io/gpuweb/#dictdef-gpuvertexattribute GPUVertexAttribute specification>
newGPUVertexAttribute :: (MonadDOM m) => GPUVertexFormat -> Word53 -> Word -> m GPUVertexAttribute
newGPUVertexAttribute format offset shaderLocation = liftDOM (((toJSVal format) >>= \a1' -> (toJSVal offset) >>= \a2' -> js_newGPUVertexAttribute a1' a2' (shaderLocation)))
foreign import javascript safe "(($1, $2) => { $1[\"format\"] = $2; })"
js_setFormat :: GPUVertexAttribute -> JSVal -> IO ()
-- | <https://gpuweb.github.io/gpuweb/#dom-gpuvertexattribute-format GPUVertexAttribute.format specification>
setFormat :: (MonadDOM m) => GPUVertexAttribute -> GPUVertexFormat -> m ()
setFormat self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setFormat (self) a2')))
foreign import javascript unsafe "(($1) => { return $1[\"format\"]; })"
js_getFormat :: GPUVertexAttribute -> IO JSVal
-- | <https://gpuweb.github.io/gpuweb/#dom-gpuvertexattribute-format GPUVertexAttribute.format specification>
getFormat :: (MonadDOM m) => GPUVertexAttribute -> m GPUVertexFormat
getFormat self = liftDOM (((js_getFormat (self)) >>= fromJSValUnchecked))
foreign import javascript safe "(($1, $2) => { $1[\"offset\"] = $2; })"
js_setOffset :: GPUVertexAttribute -> JSVal -> IO ()
-- | <https://gpuweb.github.io/gpuweb/#dom-gpuvertexattribute-offset GPUVertexAttribute.offset specification>
setOffset :: (MonadDOM m) => GPUVertexAttribute -> Word53 -> m ()
setOffset self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setOffset (self) a2')))
foreign import javascript unsafe "(($1) => { return $1[\"offset\"]; })"
js_getOffset :: GPUVertexAttribute -> IO JSVal
-- | <https://gpuweb.github.io/gpuweb/#dom-gpuvertexattribute-offset GPUVertexAttribute.offset specification>
getOffset :: (MonadDOM m) => GPUVertexAttribute -> m Word53
getOffset self = liftDOM (((js_getOffset (self)) >>= fromJSValUnchecked))
foreign import javascript safe "(($1, $2) => { $1[\"shaderLocation\"] = $2; })"
js_setShaderLocation :: GPUVertexAttribute -> Word -> IO ()
-- | <https://gpuweb.github.io/gpuweb/#dom-gpuvertexattribute-shaderlocation GPUVertexAttribute.shaderLocation specification>
setShaderLocation :: (MonadDOM m) => GPUVertexAttribute -> Word -> m ()
setShaderLocation self val = liftDOM (void ((js_setShaderLocation (self) (val))))
foreign import javascript unsafe "(($1) => { return $1[\"shaderLocation\"]; })"
js_getShaderLocation :: GPUVertexAttribute -> IO Word
-- | <https://gpuweb.github.io/gpuweb/#dom-gpuvertexattribute-shaderlocation GPUVertexAttribute.shaderLocation specification>
getShaderLocation :: (MonadDOM m) => GPUVertexAttribute -> m Word
getShaderLocation self = liftDOM ((js_getShaderLocation (self)))