A nice Haskell graphics API. There's always room for jello.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
gelatin-example
gelatin-freetype2
gelatin-fruity
gelatin-gl
gelatin-glfw
gelatin-sdl2
gelatin-shaders
gelatin-webgl
gelatin
.gitignore
.sosrc
.travis.yml
LICENSE
README.md
cabal.project
screenshot.png
stack.yaml

README.md

gelatin

Build Status

This is a mega-repo for a real-time graphics renderer in Haskell.

Screenshot

libraries

gelatin (core)

  • Backend definitions
  • Primitives for drawing
  • triangles
  • triangle strips
  • triangle fans
  • beziers (fill below curve) + inverted beziers (fill above curve)
  • thick, feathered stroked lines and for creating new backends.
  • Definitions and functions for post compilation affine transformation, color multiply, red channel replacement (for font textures)

gelatin-gl

Backend for compiling gelatin pictures using OpenGL.

gelatin-freetype2

freetype2 text using character atlases and word maps for fast rendering. Use this if your text changes frequently but does not often get resized. It is fast to compile renderings but unless the text is rendered with a large character size, scaling up the rendering will show pixels.

gelatin-fruity

Functions for extracting truetype font geometry as gelatin primitives. Use this if your text resizes frequently but otherwise does not change. It is slow to compile renderings but once compiled those renderings can be displayed at any scale.

gelatin-sdl2

SDL2 initialization and windowing.

gelatin-webgl

WebGL backend via ghcjs (experimental)

examples

For examples please see gelatin-example and odin

install

gelatin depends on

You can install them with the following platform specific steps.

Mac OS X

Using homebrew...

brew install freetype
brew install sdl2

Ubuntu

First install freetype2

apt-get install libfreetype6

The sdl2 bindings require an sdl2 install >= 2.0.4, or for special instructions to be followed. Assuming you're on Ubuntu >= 16.04, you can simply run

apt-get install libsdl2-dev

otherwise please visit the link above and install via their README.

Windows 10 with MSYS2/MINGW

pacman -S mingw-w64-x86_64-pkg-config mingw-w64-x86_64-freetype mingw-w64-x86_64-SDL2

building source

The easiest way to get up and running on the Haskell toolchain is to download stack. All of gelatin's projects are spec'd out with stack.yaml build files, so picking the correct versions of libraries is not needed if you follow the stack path.

git clone https://github.com/schell/gelatin.git

cd gelatin

If you just installed stack, run

stack setup

Go make some ☕ and then...

stack build

Note on Windows that if you run into this error

ghc-pkg.EXE: C:\sr\snapshots\3c4ad812\pkgdb\package.cache: you don't have
permission to modify this file

You can simply run stack build over and over until the thing finally compiles. facepalm - this will be fixed with ghc 8.2.

Drink your ☕, take a walk and rejoice...

contributions

I welcome any and all contributions. Feel free to tackle an issue (or a TODO) by making a pull request!

If you'd like to make a donation you can do so through patreon.

This library will always be free.