caramia: Caramia real-time hardware-accelerated rendering library

[ graphics, library, mit ] [ Propose Tags ] [ Report a vulnerability ]

This is an experimental OpenGL bindings library for real-time graphics for Haskell, using OpenGL 3.3.

Requirements:

  • GHC 7.6+

  • OpenGL 3.3 (and GL_ARB_texture_storage) (on the system where programs are run)

You need to use `-threaded` flag in executables that use this library.

Here are the most important features of this library:

  • Safe and automatic finalization of OpenGL resources

  • No implicit state (that is, no glBind* mess or equivalent). There is a monad for mass-rendering that has implicit state but the state is localized to running of that monad. (see Caramia.Render).

  • The only required extension beyond vanilla OpenGL 3.3 is GL_ARB_texture_storage. Some other extensions are used if they are available.

Here are some curious features that you might find useful.

  • This library plays nice with other OpenGL libraries. It does not mess up the implicit OpenGL state (except for aforementioned rendering monad).

  • This library does not create an OpenGL context. You can use whatever library you want to create an OpenGL context as long as it can get an OpenGL 3.3 context. You may be interested at looking at the tests in this package to see how to use this with the sdl2 package.

  • Operations are in the IO monad. No messing around with custom monads.

(At least) the following OpenGL concepts are present in this library:

  • Buffer objects (you can do low-level mapping and use raw pointers)

  • Geometry, vertex and fragment shaders

  • Indexed and non-indexed rendering

  • Framebuffers

  • Textures (with many topologies, 1D, 2D, 3D, texture arrays, cube textures; we also have buffer textures and multisampling textures)

  • Vertex array objects

  • Blending, stencil, depth and cull tests

  • Instanced rendering

  • Synchronization objects

Some notable missing features:

  • Tesselation shaders. This is an OpenGL 4.x feature but we could add it.

  • Using shaders with transform feedback.

  • Multi-threaded rendering.

This library tries to avoid including obsolete or redundant features of OpenGL.

One major flaw(?) of this library is that OpenGL resources cannot be easily released promptly. This may or may not be a problem for you. OpenGL resources may refer to each other behind the scenes so if we implement a mechanism to release resources early, this mechanism needs to take care of resources referring to each other.

Expect bugs. While this library has been tested in some of the author's toy programs, the library currently lacks automatic tests.


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0, 0.2.0.0, 0.2.0.1, 0.3.0.0, 0.3.0.1, 0.4.0.0, 0.5.0.0, 0.6.0.0, 0.7.0.0, 0.7.0.1, 0.7.1.0, 0.7.1.1, 0.7.2.0, 0.7.2.1, 0.7.2.2
Dependencies base (>=4.6 && <5.0.0.0), bytestring (>=0.10 && <1.0), containers (>=0.5 && <1.0), OpenGLRaw (>=1.5 && <2.0), semigroups (>=0.15 && <1.0), text (>=0.9 && <2.0), transformers (>=0.4 && <1.0), vector (>=0.10 && <1.0) [details]
License MIT
Copyright Copyright (c) 2014 Mikko Juola
Author Mikko Juola
Maintainer mikjuo@gmail.com
Category Graphics
Home page https://github.com/Noeda/caramia/
Source repo head: git clone https://github.com/Noeda/caramia.git
Uploaded by Adeon at 2014-10-21T03:00:48Z
Distributions
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 10877 total (59 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for caramia-0.2.0.0

[back to package description]

This is an OpenGL bindings library for real-time graphics for Haskell, using OpenGL 3.3.

Requirements:

  • GHC 7.6+
  • OpenGL 3.3 (and GL_ARB_texture_storage) (on the system where programs are run)

You need to use -threaded flag in executables that use this library.

Here are the most important features of this library:

  • Safe and automatic finalization of OpenGL resources

  • No implicit state (that is, no glBind* mess or equivalent). There is a monad for mass-rendering that has implicit state but the state is localized to running of that monad. (see Caramia.Render).

  • The only required extension beyond vanilla OpenGL 3.3 is GL_ARB_texture_storage. Some other extensions are used if they are available.

Here are some curious features that you might find useful.

  • This library plays nice with other OpenGL libraries. It does not mess up the implicit OpenGL state (except for aforementioned rendering monad).

  • This library does not create an OpenGL context. You can use whatever library you want to create an OpenGL context as long as it can get an OpenGL 3.3 context. You may be interested at looking at the tests in this package to see how to use this with the sdl2 package.

  • Operations are in the IO monad. No messing around with custom monads.

(At least) the following OpenGL concepts are present in this library:

  • Buffer objects (you can do low-level mapping and use raw pointers)

  • Geometry, vertex and fragment shaders

  • Indexed and non-indexed rendering

  • Framebuffers

  • Textures (with many topologies, 1D, 2D, 3D, texture arrays, cube textures; we also have buffer textures and multisampling textures)

  • Vertex array objects

  • Blending, stencil, depth and cull tests

  • Instanced rendering

  • Synchronization objects

Some notable missing features:

  • Tesselation shaders. This is an OpenGL 4.x feature but we could add it.

  • Using shaders with transform feedback.

  • Multi-threaded rendering.

This library tries to avoid including obsolete or redundant features of OpenGL.

One major flaw(?) of this library is that OpenGL resources cannot be easily released promptly. This may or may not be a problem for you. OpenGL resources may refer to each other behind the scenes so if we implement a mechanism to release resources early, this mechanism needs to take care of resources referring to each other.

Expect bugs. While this library has been tested in some of the author's toy programs, the library currently lacks automatic tests.