Module

Graphics.WebGL

Package
purescript-webgl
Repository
jutaro/purescript-webgl

WebGL binding for purescript

#WebGLContext Source

type WebGLContext = { canvasName :: String }

#ContextAttributes Source

type ContextAttributes = { alpha :: Boolean, antialias :: Boolean, depth :: Boolean, failIfMajorPerformanceCaveat :: Boolean, preferLowPowerToHighPerformance :: Boolean, premultipliedAlpha :: Boolean, preserveDrawingBuffer :: Boolean, stencil :: Boolean }

#runWebGLAttr Source

runWebGLAttr :: forall a eff. String -> ContextAttributes -> (String -> Eff eff a) -> (WebGLContext -> EffWebGL eff a) -> Eff eff a

pures either a continuation which takes a String in the error case,

#runWebGL Source

runWebGL :: forall a eff. String -> (String -> Eff eff a) -> (WebGLContext -> EffWebGL eff a) -> Eff eff a

Same as runWebGLAttr but uses default attributes (defContextAttributes)

#Uniform Source

newtype Uniform typ

Constructors

#Attribute Source

newtype Attribute typ

Constructors

#Vec2 Source

data Vec2

#Vec3 Source

data Vec3

#Vec4 Source

data Vec4

#Mat2 Source

data Mat2

#Mat3 Source

data Mat3

#Mat4 Source

data Mat4

#Sampler2D Source

#Bool Source

data Bool

#Float Source

data Float

#WebGLProg Source

newtype WebGLProg

#Shaders Source

data Shaders bindings

Constructors

#requestAnimationFrame Source

requestAnimationFrame :: forall a eff. Eff (webgl :: WebGl | eff) a -> Eff (webgl :: WebGl | eff) Unit

#withShaders Source

withShaders :: forall bindings eff a. Shaders (Record bindings) -> (String -> EffWebGL eff a) -> ({ webGLProgram :: WebGLProg | bindings } -> EffWebGL eff a) -> EffWebGL eff a

#bindAttribLocation Source

bindAttribLocation :: forall eff. WebGLProg -> Int -> String -> Eff (webgl :: WebGl | eff) Unit

#Buffer Source

type Buffer a = { bufferSize :: Int, bufferType :: Int, webGLBuffer :: WebGLBuffer a }

#makeBufferFloat Source

makeBufferFloat :: forall eff. Array Number -> Eff (webgl :: WebGl | eff) (Buffer Float32)

#makeBufferFloatDyn Source

makeBufferFloatDyn :: forall eff. Array Number -> Eff (webgl :: WebGl | eff) (Buffer Float32)

#makeBuffer Source

makeBuffer :: forall a eff num. EuclideanRing num => BufferTarget -> (Array num -> ArrayView a) -> Array num -> Eff (webgl :: WebGl | eff) (Buffer a)

#makeBufferDyn Source

makeBufferDyn :: forall a eff num. EuclideanRing num => BufferTarget -> (Array num -> ArrayView a) -> Array num -> Eff (webgl :: WebGl | eff) (Buffer a)

#makeBufferPrim Source

makeBufferPrim :: forall a eff. BufferTarget -> ArrayView a -> Eff (webgl :: WebGl | eff) (Buffer a)

#makeBufferPrimDyn Source

makeBufferPrimDyn :: forall a eff. BufferTarget -> ArrayView a -> Eff (webgl :: WebGl | eff) (Buffer a)

#fillBuffer Source

fillBuffer :: forall a eff. Buffer a -> Int -> Array Number -> Eff (webgl :: WebGl | eff) Unit

#setUniformFloats Source

setUniformFloats :: forall eff typ. Uniform typ -> Array Number -> EffWebGL eff Unit

#setUniformBoolean Source

setUniformBoolean :: forall eff typ. Uniform typ -> Boolean -> EffWebGL eff Unit

#bindBufAndSetVertexAttr Source

bindBufAndSetVertexAttr :: forall a eff typ. Buffer a -> Attribute typ -> Eff (webgl :: WebGl | eff) Unit

#bindBuf Source

bindBuf :: forall a eff. Buffer a -> Eff (webgl :: WebGl | eff) Unit

#blendColor Source

blendColor :: forall eff. GLclampf -> GLclampf -> GLclampf -> GLclampf -> Eff (webgl :: WebGl | eff) Unit

#blendFunc Source

blendFunc :: forall eff. BlendingFactor -> BlendingFactor -> (Eff (webgl :: WebGl | eff) Unit)

#blendFuncSeparate Source

#blendEquation Source

blendEquation :: forall eff. BlendEquation -> (Eff (webgl :: WebGl | eff) Unit)

#blendEquationSeparate Source

blendEquationSeparate :: forall eff. BlendEquation -> BlendEquation -> (Eff (webgl :: WebGl | eff) Unit)

#clear Source

clear :: forall eff. Array Mask -> (Eff (webgl :: WebGl | eff) Unit)

#clearColor Source

clearColor :: forall eff. GLclampf -> GLclampf -> GLclampf -> GLclampf -> Eff (webgl :: WebGl | eff) Unit

#clearDepth Source

clearDepth :: forall eff. GLclampf -> Eff (webgl :: WebGl | eff) Unit

#clearStencil Source

clearStencil :: forall eff. GLint -> Eff (webgl :: WebGl | eff) Unit

#colorMask Source

colorMask :: forall eff. GLboolean -> GLboolean -> GLboolean -> GLboolean -> Eff (webgl :: WebGl | eff) Unit

#depthFunc Source

depthFunc :: forall eff. Func -> Eff (webgl :: WebGl | eff) Unit

#disable Source

disable :: forall eff. Capacity -> (Eff (webgl :: WebGl | eff) Unit)

#drawArr Source

drawArr :: forall a eff typ. Mode -> Buffer a -> Attribute typ -> EffWebGL eff Unit

#drawElements Source

drawElements :: forall eff. Mode -> Int -> EffWebGL eff Unit

#enable Source

enable :: forall eff. Capacity -> (Eff (webgl :: WebGl | eff) Unit)

#isContextLost Source

isContextLost :: forall eff. Eff (webgl :: WebGl | eff) Boolean

#isEnabled Source

isEnabled :: forall eff. Capacity -> (Eff (webgl :: WebGl | eff) Boolean)

#vertexPointer Source

vertexPointer :: forall eff typ. Attribute typ -> EffWebGL eff Unit

#viewport Source

viewport :: forall eff. GLint -> GLint -> GLsizei -> GLsizei -> Eff (webgl :: WebGl | eff) Unit

#enableVertexAttribArray Source

enableVertexAttribArray :: forall eff a. Attribute a -> (Eff (webgl :: WebGl | eff) Unit)

#disableVertexAttribArray Source

disableVertexAttribArray :: forall eff a. Attribute a -> (Eff (webgl :: WebGl | eff) Unit)

#getCanvasWidth Source

getCanvasWidth :: forall eff. WebGLContext -> Eff (webgl :: WebGl | eff) Int

#getCanvasHeight Source

getCanvasHeight :: forall eff. WebGLContext -> Eff (webgl :: WebGl | eff) Int