opengles-0.7.0: OpenGL ES 2.0 and 3.0 with EGL 1.4

Copyright(c) capsjac 2014
LicenseLGPL-3 (see the file LICENSE)
Safe HaskellNone
LanguageHaskell2010

Graphics.OpenGLES.Core

Contents

Description

The neat and easy to use wrapper for OpenGL EmbedSystems (ES). The wrapper is optimised for mobile and have small footprint. Assuming OpenGL ES 2.0 or any later version, however, also works with OpenGL 4.1/4.3+ on desktop.

Synopsis

Documentation

type GL = IO Source

IO actions run in GL thread.

Lifecycle

forkGL :: IO Bool -> GL () -> GL () -> IO ThreadId Source

runGL :: GL () -> IO () Source

withGL :: GL a -> IO (Future' a) Source

resetDrawQueue :: IO () Source

drawQueue may have drawcalls that use previous context, so make it sure they are removed from the queue.

framesize :: Int -> Int -> IO () Source

GLFW.setFramebufferSizeCallback win $ Just (const framesize)

Draw Operation

Clear Screen

Draw

Draw Mode

Graphics State

renderTo :: RenderConfig -> GL () Source

renderTo $ do
    bindFb defaultFramebuffer
    viewport $ V4 0 0 512 512
    depthRange $ V2 0.1 10.0
    begin culling
    cullFace hideBack

Programmable Shader

data Shader Source

Instances

computeShader :: GLName -> ByteString -> Shader Source

Compute shader requires ES3.1+

geometryShader :: GLName -> ByteString -> Shader Source

Geometry shader requires GL_EXT_geometry_shader (ES3.1)

tessellationEvalS :: GLName -> ByteString -> Shader Source

Tessellation Shader requires GL_EXT_tessellation_shader (ES3.1)

tessellationCtrlS :: GLName -> ByteString -> Shader Source

Tessellation Shader requires GL_EXT_tessellation_shader (ES3.1)

data Program p Source

Instances

glValidate :: Program p -> GL String Source

glValidateProgram checks to see whether the executables contained in program can execute given the current OpenGL state.

Uniform Variable

data Uniform p a Source

uniform :: forall p a. (UnifVal a, Typeable p) => GLName -> IO (Uniform p a) Source

($=) :: UnifVal a => Uniform p a -> a -> UniformAssignment p infix 0 Source

Vertex Attribute Array

data Attrib p a Source

Instances

Show (Attrib p a) 
(VertexAttribute a, (~) * (Vectorize a) (v a'), (~) * (Vectorize b) (v b'), KnownNat (VDim v), AttrElement b', VertexAttributeArray a' b') => AttrStruct (Attrib p a) p b 
(VertexAttribute (f (g a)), Applicative g, Floating a, FoldableWithIndex (E V4) g, KnownNat (VDim f), KnownNat (SizeOf (f a)), KnownNat (SizeOf (f (g a))), AttrElement a) => AttrStruct (Attrib p (f (g a))) p (f (g a)) 

attrib :: forall p a. (VertexAttribute a, Typeable p) => GLName -> IO (Attrib p a) Source

normalized color divisor 1 &= buffer

divisor :: Attrib p a -> Word32 -> Attrib p a Source

(&=) :: AttrStruct a p b => a -> Buffer b -> SetVertexAttr p infix 0 Source

class AttrStruct a p b | a -> p Source

A set of VertexAttributes packed in a Buffer

Minimal complete definition

glVertexBuffer

Instances

(VertexAttribute a, (~) * (Vectorize a) (v a'), (~) * (Vectorize b) (v b'), KnownNat (VDim v), AttrElement b', VertexAttributeArray a' b') => AttrStruct (Attrib p a) p b 
(VertexAttribute (f (g a)), Applicative g, Floating a, FoldableWithIndex (E V4) g, KnownNat (VDim f), KnownNat (SizeOf (f a)), KnownNat (SizeOf (f (g a))), AttrElement a) => AttrStruct (Attrib p (f (g a))) p (f (g a)) 

type SetVertexAttr p = GL () Source

Constant Vertex Attribute

Texture

Vertex Picker

class VertexIx a Source

Minimal complete definition

vxix