A port of the gloss library from Haskell to Idris, based on version 220.127.116.11. With kind permission from Ben Lippmeier.
Differences to Haskell version
- PNG only - at the moment only loading of PNG instead of BMP is supported (C bindings for loading PNGs files existed already in https://github.com/eckart/gl-idris so I simply adopted it to my purposes)
- GLEW only - scratched GLUT support because it is completely outdated and should be replaced by GLEW. Unfortunately we lost the ability for text-rendering. Note that GLUT is still used for font-rendering
- The original Haskell gloss library itself is split into gloss and gloss-rendering. I integrated both into this single library because I saw no point in splitting it for Idris. Also because of Idris' lack of a proper package management system like cabal, having too many dependencies on 3rd party libraries in a project can become quite annoying. If in the future there is a real need for separating out the gloss-rendering functionality, this can be done quite easily. Also the original Haskell gloss library has a large number of examples which are distributed in the gloss-examples library. I integrated this library into this as well for the same reasons. There exists two additional packages in Haskells gloss universe: gloss-raster which supports parallel rendering of raster images (e.g. Raytracing) and gloss-algorithms which provide data structures and algorithms for working with 2D graphics. I plan on porting them (and their respective examples which are located in the examples folder) in the future.
Library Version: 0.2
After solving issue #8 and adding BMP support the version will be set to 1.0 as this will then be a proper port. See ChangeLog.md.
Idris versions: 1.2, 1.3
Idris Package Dependencies
- glfw-idris-st: https://github.com/thalerjonathan/glfw-idris-st
- gl-idris-b: https://github.com/thalerjonathan/gl-idris-b
- libpng: for loading PNG files
- glfw3: for interfacing with the window manager of the respective system (due to glfw-idris-st)
- glew: for loading the OpenGL functions on the respective system (due to gl-idris-b)
- freeglut: for font-rendering
Building the library
- Assuming you have installed Idris and it is on your path.
- Make sure libpng, glfw3, glew and freeglut are installed on your system and can be found by pkg-config. On Linux use the package manager of your system, on Mac OS X use brew install.
- Download / clone glfw-idris-st from https://github.com/thalerjonathan/glfw-idris-st and install it.
- Download / clone gl-idris-b from https://github.com/thalerjonathan/gl-idris-b and install it.
- Download / clone gloss-idris
- Install the library by navigating to the gloss-idris folder and simply invoke 'make' in a terminal.
Running the examples
- Assuming you have installed Idris and it is on your path and you have successfully built and installed gloss-idris on your system.
- Download / clone gloss-idris.
- Navigate to src/examples/ where the examples are located.
- Compile your example of choice by navigating to its folder and simply invoking 'make' in a terminal.
- Run the example.