Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Latest commit

 

History

History
35 lines (26 loc) · 1.7 KB

README.textile

File metadata and controls

35 lines (26 loc) · 1.7 KB

Penumbra is an idiomatic wrapper for OpenGL in Clojure, by way of LWJGL.

This Java/C code

glEnable(GL_LIGHT0);
glPushMatrix();
glTranslated(0, 0, -10);
glBegin(GL_QUADS);
glVertex3d(0, 0, 0);
glVertex3d(0, 1, 0);
glVertex3d(1, 1, 0);
glVertex3d(1, 0, 0);
glEnd();
glPopMatrix();

becomes

(enable :light0)
(push-matrix
  (translate 0 0 -10)
  (draw-quads
    (vertex 0 0 0)
    (vertex 0 1 0)
    (vertex 1 1 0)
    (vertex 1 0 0)))

Numerous sample programs can be found in /src/example. They include clean, functional implementations of Tetris and Asteroids, and a GPU-driven Mandelbrot viewer.

A long term goal for Penumbra is to simplify GPU programming as much as possible, allowing for both advanced graphical effects and general computation. This is a work in progress, but this n-body simulation is a good example of what’s possible.

Using Penumbra

The master branch of Penumbra targets version 1.2.0 for clojure and clojure-contrib. As a result, Leiningen doesn’t fully work. If you want seamless interop with Leiningen, consider using the 0.5.0 branch. Directions for installation and use in other projects can be found here.

If you have any questions, please visit the mailing list.