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 eff a. 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 eff a. 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 eff a. Eff (webgl :: WebGl | eff) a -> Eff (webgl :: WebGl | eff) Unit

#withShaders Source

withShaders :: forall a eff bindings. 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 num eff a. EuclideanRing num => BufferTarget -> (Array num -> ArrayView a) -> Array num -> Eff (webgl :: WebGl | eff) (Buffer a)

#makeBufferDyn Source

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

#makeBufferPrim Source

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

#makeBufferPrimDyn Source

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

#fillBuffer Source

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

#setUniformFloats Source

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

#setUniformBoolean Source

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

#bindBufAndSetVertexAttr Source

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

#bindBuf Source

bindBuf :: forall eff a. 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 typ eff a. 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 typ eff. Attribute typ -> EffWebGL eff Unit

#viewport Source

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

#enableVertexAttribArray Source

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

#disableVertexAttribArray Source

disableVertexAttribArray :: forall a eff. 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