runWebgl :: forall eff a . WebGL a -> Raw.WebGLContext -> Eff (canvas :: Canvas | eff ) (Either WebGLError a )
runWebglWithShaders :: forall eff attrs uniforms a . (WebGLProgram -> Object attrs -> Object uniforms -> WebGL a ) -> WebGLContext -> String -> String -> Eff (canvas :: Canvas | eff ) (Either WebGLError a )
Module Graphics.WebGL.Context
defaultWebglContextAttrs :: WebGLContextAttributes
getWebglContextWithAttrs :: forall eff . CanvasElement -> WebGLContextAttributes -> Eff (canvas :: Canvas | eff ) (Maybe WebGLContext )
getWebglContext :: forall eff . CanvasElement -> Eff (canvas :: Canvas | eff ) (Maybe WebGLContext )
canvasElement :: WebGL CanvasElement
drawingBufferHeight :: WebGL Number
drawingBufferWidth :: WebGL Number
Module Graphics.WebGL.Methods
attachShader :: WebGLProgram -> WebGLShader -> WebGL Unit
bindBuffer :: ArrayBufferType -> WebGLBuffer -> WebGL Unit
bufferData :: ArrayBufferType -> BufferData -> BufferUsage -> WebGL Unit
clear :: BufferType -> WebGL Unit
clearColor :: Number -> Number -> Number -> Number -> WebGL Unit
compileShader :: WebGLShader -> WebGL Unit
createBuffer :: WebGL WebGLBuffer
createProgram :: WebGL WebGLProgram
createShader :: ShaderType -> WebGL WebGLShader
drawArrays :: DrawMode -> Number -> Number -> WebGL Unit
enableVertexAttribArray :: forall a . Attribute a -> WebGL Unit
getProgramParameter :: forall a . WebGLProgram -> ProgramParam -> WebGL a
isContextLost :: WebGL Boolean
linkProgram :: WebGLProgram -> WebGL Unit
shaderSource :: WebGLShader -> String -> WebGL Unit
uniform1f :: forall u . Uniform u -> Number -> WebGL Unit
uniform1fv :: forall u . Uniform u -> Float32Array -> WebGL Unit
uniform2f :: forall u . Uniform u -> Number -> Number -> WebGL Unit
uniform2fv :: forall u . Uniform u -> Float32Array -> WebGL Unit
uniform3f :: forall u . Uniform u -> Number -> Number -> Number -> WebGL Unit
uniform3fv :: forall u . Uniform u -> Float32Array -> WebGL Unit
uniform4f :: forall u . Uniform u -> Number -> Number -> Number -> Number -> WebGL Unit
uniform4fv :: forall u . Uniform u -> Float32Array -> WebGL Unit
useProgram :: WebGLProgram -> WebGL Unit
vertexAttrib1f :: forall a . Attribute a -> Number -> WebGL Unit
vertexAttrib1fv :: forall a . Attribute a -> Float32Array -> WebGL Unit
vertexAttrib2f :: forall a . Attribute a -> Number -> Number -> WebGL Unit
vertexAttrib2fv :: forall a . Attribute a -> Float32Array -> WebGL Unit
vertexAttrib3f :: forall a . Attribute a -> Number -> Number -> Number -> WebGL Unit
vertexAttrib3fv :: forall a . Attribute a -> Float32Array -> WebGL Unit
vertexAttrib4f :: forall a . Attribute a -> Number -> Number -> Number -> Number -> WebGL Unit
vertexAttrib4fv :: forall a . Attribute a -> Float32Array -> WebGL Unit
vertexAttribPointer :: forall a . Attribute a -> Number -> DataType -> Boolean -> Number -> Number -> WebGL Unit
Module Graphics.WebGL.Shader
instance setVertAttrNumber :: SetVertAttr Number
instance setVertAttrVec2 :: SetVertAttr Vec2
instance setVertAttrVec3 :: SetVertAttr Vec3
instance setVertAttrVec4 :: SetVertAttr Vec4
instance setUniformNumber :: SetUniform Number
instance setUniformVec2 :: SetUniform Vec2
instance setUniformVec3 :: SetUniform Vec3
instance setUniformVec4 :: SetUniform Vec4
addShaderToProgram :: WebGLProgram -> ShaderType -> String -> WebGL Unit
compileShadersIntoProgram
compileShadersIntoProgram :: String -> String -> WebGL WebGLProgram
getAttrBindings :: forall bindings . WebGLProgram -> WebGL (Object bindings )
getUniformBindings :: forall bindings . WebGLProgram -> WebGL (Object bindings )
Module Graphics.WebGL.Types
type WebGLT eff a = ReaderT Raw.WebGLContext (ErrorT WebGLError eff ) a
type WebGL a = forall eff . WebGLT (Eff (canvas :: Canvas | eff )) a
data WebGLError
= ContextLost
| ErrorCode ErrorCode
| NullValue String
| ShaderError String
instance showWebGLError :: Show WebGLError
type WebGLBuffer = Raw.WebGLBuffer
type WebGLContext = Raw.WebGLContext
type WebGLContextAttributes = Raw.WebGLContextAttributes
type WebGLProgram = Raw.WebGLProgram
type WebGLShader = Raw.WebGLShader
type WebGLUniformLocation = Raw.WebGLUniformLocation
data Vec2
= Vec2 Number Number
data Vec3
= Vec3 Number Number Number
data Vec4
= Vec4 Number Number Number Number
data Mat2
= Mat2 Number Number Number Number
data Mat3
= Mat3 Number Number Number Number Number Number Number Number Number
data Mat4
= Mat4 Number Number Number Number Number Number Number Number Number Number Number Number Number Number Number Number
newtype Attribute a
= Attribute Number
newtype Uniform a
= Uniform WebGLUniformLocation
class ToWebGLEnum a where
toWebglEnum :: a -> Number
class FromWebGLEnum a where
fromWebglEnum :: Number -> a
data ArrayBufferType
= ArrayBuffer
| ElementArrayBuffer
toWebglEnumArrayBufferType
instance toWebglEnumArrayBufferType :: ToWebGLEnum ArrayBufferType
data BufferType
= DepthBuffer
| ColorBuffer
| StencilBuffer
instance toWebglEnumBufferType :: ToWebGLEnum BufferType
data BufferUsage
= DynamicDraw
| StaticDraw
| StreamDraw
instance toWebglEnumBufferUsage :: ToWebGLEnum BufferUsage
data DataType
= Byte
| UnsignedByte
| Short
| UnsignedShort
| Int
| UnsignedInt
| Float
instance toWebglEnumDataType :: ToWebGLEnum DataType
data DrawMode
= Points
| Lines
| LineLoop
| LineStrip
| Triangles
| TriangleStrip
| TriangleFan
instance toWebglEnumDrawMode :: ToWebGLEnum DrawMode
data ErrorCode
= NoError
| InvalidEnum
| InvalidValue
| InvalidOperation
| OutOfMemory
| UnknownError
instance fromWebglEnumErrorCode :: FromWebGLEnum ErrorCode
instance showErrorCode :: Show ErrorCode
data ProgramParam
= DeleteStatus
| LinkStatus
| ValidateStatus
| AttachedShaders
| ActiveAttrs
| ActiveUniforms
instance toWebglEnumProgramParam :: ToWebGLEnum ProgramParam
data ShaderType
= FragmentShader
| VertexShader
instance toWebglEnumShader :: ToWebGLEnum ShaderType
data BufferData
= DataSize Number
| DataSource Float32Array
Module Graphics.WebGL.Unsafe
unsafeCoerce :: forall a b . a -> b