gelatin-0.0.0.2: An experimental real time renderer.

Safe HaskellNone
LanguageHaskell2010

Gelatin.Core.Rendering

Synopsis

Documentation

initGelatin :: IO Bool Source

Initializes the system. This must be called before creating a window. Returns True when initialization was successful.

newWindow Source

Arguments

:: Int

Width

-> Int

Height

-> String

Title

-> Maybe Monitor

The monitor to fullscreen into.

-> Maybe Window

A window to share OpenGL contexts with.

-> IO Window 

Creates a window. This can only be called after initializing with initGelatin.

loadGeomRenderSource :: IO GeomRenderSource Source

Loads a new shader program and attributes for rendering geometry.

loadBezRenderSource :: IO BezRenderSource Source

Loads a new shader progarm and attributes for rendering beziers.

loadMaskRenderSource :: IO MaskRenderSource Source

Loads a new shader program and attributes for masking textures.

loadTexture :: DynamicImage -> IO GLuint Source

loadTextureUnit :: Maybe GLuint -> DynamicImage -> IO GLuint Source

unloadTexture :: GLuint -> IO () Source

filledTriangleRendering :: Window -> GeomRenderSource -> [Triangle (V2 Float)] -> Fill -> IO Rendering Source

Creates and returns a renderer that renders a given string of triangles with the given filling.

colorRendering :: Window -> GeomRenderSource -> GLuint -> [V2 Float] -> [V4 Float] -> IO Rendering Source

Creates and returns a renderer that renders the given colored geometry.

colorBezRendering :: Window -> BezRenderSource -> [Bezier (V2 Float)] -> [Triangle (V4 Float)] -> IO Rendering Source

Creates and returns a renderer that renders the given colored beziers.

colorFontRendering :: Window -> GeomRenderSource -> BezRenderSource -> FontString -> (V2 Float -> V4 Float) -> IO Rendering Source

TODO: textureFontRendering and then fontRendering.

Creates and returns a renderer that renders a given FontString.

textureRendering :: Window -> GeomRenderSource -> GLuint -> [V2 Float] -> [V2 Float] -> IO Rendering Source

Creates and returns a renderer that renders a textured geometry using the texture bound to GL_TEXTURE0.

textureUnitRendering :: Maybe GLint -> Window -> GeomRenderSource -> GLuint -> [V2 Float] -> [V2 Float] -> IO Rendering Source

Creates and returns a renderer that renders the given textured geometry using the specified texture binding.

maskRendering :: Window -> MaskRenderSource -> GLuint -> [V2 Float] -> [V2 Float] -> IO Rendering Source

Creates and returns a renderer that masks a textured rectangular area with another texture.

stencilMask :: IO () -> IO () -> IO () Source

Creates an IO () drawing computation that masks an IO () drawing computation with another using a stencil test.

alphaMask :: Window -> MaskRenderSource -> IO () -> IO () -> IO Rendering Source

Creates a rendering that masks an IO () drawing computation with the alpha value of another.

toTexture :: Window -> IO () -> IO GLuint Source

toTextureUnit :: Maybe GLuint -> Window -> IO () -> IO GLuint Source

clipTexture :: GLuint -> ClippingArea -> IO GLuint Source

Sub-samples a texture using the given coordinate box and creates a new texture. Keep in mind that OpenGL texture coordinates are flipped from normal graphics coordinates (y = 0 is the bottom of the texture). That fact has bitten the author a number of times while clipping a texture created with toTexture and toUnitTexture.