typograffiti-0.1.0.3: Just let me draw nice text already

Safe HaskellNone
LanguageHaskell2010

Typograffiti.GL

Synopsis

Documentation

withVAO :: MonadIO m => (GLuint -> IO b) -> m b Source #

withBuffers :: MonadIO m => Int -> ([GLuint] -> m b) -> m b Source #

bufferGeometry Source #

Arguments

:: (Foldable f, Unbox (f Float), Storable (f Float), Finite f, KnownNat (Size f), MonadIO m) 
=> GLuint

The attribute location.

-> GLuint

The buffer identifier.

-> Vector (f Float)

The geometry to buffer.

-> m () 

Buffer some geometry into an attribute. The type variable f should be V0, V1, V2, V3 or V4.

withBoundTextures :: MonadIO m => [GLuint] -> m a -> m a Source #

Binds the given textures to GL_TEXTURE0, GL_TEXTURE1, ... in ascending order of the texture unit, runs the IO action and then unbinds the textures.

drawVAO Source #

Arguments

:: MonadIO m 
=> GLuint

The program

-> GLuint

The vao

-> GLenum

The draw mode

-> GLsizei

The number of vertices to draw

-> m () 

compileOGLShader Source #

Arguments

:: MonadIO m 
=> ByteString

The shader source

-> GLenum

The shader type (vertex, frag, etc)

-> m (Either String GLuint)

Either an error message or the generated shader handle.

class UniformValue a where Source #

Methods

updateUniform Source #

Arguments

:: MonadIO m 
=> GLuint

The program

-> GLint

The uniform location

-> a

The value.

-> m () 
Instances
UniformValue Bool Source # 
Instance details

Defined in Typograffiti.GL

Methods

updateUniform :: MonadIO m => GLuint -> GLint -> Bool -> m () Source #

UniformValue Double Source # 
Instance details

Defined in Typograffiti.GL

Methods

updateUniform :: MonadIO m => GLuint -> GLint -> Double -> m () Source #

UniformValue Float Source # 
Instance details

Defined in Typograffiti.GL

Methods

updateUniform :: MonadIO m => GLuint -> GLint -> Float -> m () Source #

UniformValue Int Source # 
Instance details

Defined in Typograffiti.GL

Methods

updateUniform :: MonadIO m => GLuint -> GLint -> Int -> m () Source #

UniformValue (M44 Float) Source # 
Instance details

Defined in Typograffiti.GL

Methods

updateUniform :: MonadIO m => GLuint -> GLint -> M44 Float -> m () Source #

UniformValue (V4 Float) Source # 
Instance details

Defined in Typograffiti.GL

Methods

updateUniform :: MonadIO m => GLuint -> GLint -> V4 Float -> m () Source #

UniformValue (V3 Float) Source # 
Instance details

Defined in Typograffiti.GL

Methods

updateUniform :: MonadIO m => GLuint -> GLint -> V3 Float -> m () Source #

UniformValue (V2 Float) Source # 
Instance details

Defined in Typograffiti.GL

Methods

updateUniform :: MonadIO m => GLuint -> GLint -> V2 Float -> m () Source #

UniformValue (V2 Int) Source # 
Instance details

Defined in Typograffiti.GL

Methods

updateUniform :: MonadIO m => GLuint -> GLint -> V2 Int -> m () Source #

UniformValue (Int, Int) Source # 
Instance details

Defined in Typograffiti.GL

Methods

updateUniform :: MonadIO m => GLuint -> GLint -> (Int, Int) -> m () Source #

clearUniformUpdateError :: (MonadIO m, Show a) => GLuint -> GLint -> a -> m () Source #

mat4Translate :: Num a => V3 a -> M44 a Source #

mat4Rotate :: (Num a, Epsilon a, Floating a) => a -> V3 a -> M44 a Source #

mat4Scale :: Num a => V3 a -> M44 a Source #

orthoProjection Source #

Arguments

:: Integral a 
=> V2 a

The window width and height

-> M44 Float 

boundingBox :: (Unbox a, Real a, Fractional a) => Vector (V2 a) -> (V2 a, V2 a) Source #