The GLFW package

[Tags: bsd3, library]

A Haskell binding for GLFW, a window system independent toolkit for writing OpenGL programs. For more information about the C library on which this binding is based, please see http://www.glfw.org. Note that this binding comes with an older GLFW C version 2.7.9 due to incompatible API changes GLFW since 3.0 (for example, the removal of texture functions). If you want to use newer GLFW C versions, install Haskell package GLFW-b instead.


[Skip to ReadMe]

Properties

Versions0.2, 0.3, 0.4.1, 0.4.2, 0.5.0.0, 0.5.0.1, 0.5.1.0, 0.5.2.0, 0.5.2.1, 0.5.2.2, 0.5.2.3, 0.5.2.4
Change logChangelog.txt
Dependenciesbase (>=3 && <5), OpenGL (>=2.1 && <3) [details]
LicenseBSD3
MaintainerPaul H. Liu <paul@thev.net>, Marc Sunet <jeannekamikaze@gmail.com>
CategoryGraphics
Home pagehttp://haskell.org/haskellwiki/GLFW
Source repositoryhead: darcs get http://code.haskell.org/GLFW/
UploadedFri Oct 4 07:03:51 UTC 2013 by PaulLiu
DistributionsDebian:0.5.1.0, NixOS:0.5.2.4
Downloads6451 total (267 in last 30 days)
Votes
0 []
StatusDocs available [build log]
Successful builds reported [all 3 reports]

Modules

[Index]

Flags

NameDescriptionDefault
dynamicDynamically link with GLFW C libray if your system provides it.Disabled

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Maintainers' corner

For package maintainers and hackage trustees

Readme for GLFW-0.5.2.0

This is a Haskell module for GLFW OpenGL framework
(http://www.glfw.org). It provides an alternative
to GLUT for OpenGL based Haskell programs.

SOE (http://www.cs.yale.edu/homes/hudak/SOE/) now 
depends on this package.

The website for this Haskell module is at Haskell Wiki site:
http://haskell.org/haskellwiki/GLFW

=======
Changes
=======

See separate file "Changlog.txt".

============
Installation
============

The package comes together with a (partial) source distribution 
of GLFW v2.7.9, which is compiled and installed together with
the Haskell package.

If you already have the Haskell package cabal-install, you can
simply do "cabal install GLFW", and it will download the latest
source from HackageDB, configure, compile, and install it 
automatically.

Otherwise, you may follow the standard Cabal package installation 
steps:

1. To configure the module, type

       runhaskell Setup.hs configure
   or

       runhaskell Setup.hs configure --user --prefix=DIR

   if you want to install the package to your user's directory
   instead of the system one (replace DIR with your own directory
   choice).

2. To build the module, type 

       runhaskell Setup.hs build

3. To install, type 

       runhaskell Setup.hs install   

In the process it builds all GLFW C library source code. You may
use "runhaskell Setup.hs build --verbose" to see the actual 
compilation steps.

4. Optionally to build its Haddock documentation, type

       runhaskell Setup.hs haddock

====
NOTE
====

For Windows users, you may have to include GHC's gcc-lib directory 
in your PATH environment, e.g., c:\ghc\ghc-7.6.3\gcc-lib, before 
configuring the GLFW module, otherwise it'll complain about missing
program for ld.

For Linux users there is an option to link to a system wide GLFW 
dynamical library instead of compilation from source. It can be
done by providing "--flags=dynamic" as an option to cabal configure
command. 

For Mac users, unfortunately interactively running GLFW programs
from GHCi would result in a crash if you use GHC 7.6.3 or older. 
The only sensible way is to compile and run the program, or use
GHC 7.8 or newer. 

=============
Package Usage
=============

The package is tested with GHC 7.4.2 and GHC 7.6.3 on all
three platforms (Linux, Win32/MinGW, and Mac OS X). Though it may
work with older versions of GHC or even Hugs, they are not tested.

It installs a new Haskell package called "GLFW" and the actual
module to import is "Graphics.UI.GLFW". You'll need to pass 
"-package GLFW" to GHC if you want to compile it.

GLFW itself is well documented (see GLFW website), and the
Haskell module API is documented via Haddock. 

Not all functions are fully tested, and there are still a 
few GLFW C functions missing from the Haskell module, namely 
the image loading functions. They are excluded because image
handling is a separate issue, and low level buffer manipulation
would obscure their use further. Texture loading from TGA
format is supported both from file and from memory (via a
string buffer). 

The Haskell module also provides basic text rendering while
GLFW doesn't. It comes from a free 8x16 font which is made
into a TGA texture, stored as a Haskell string in the file 
GLFW.hs (also the reason for its big size). Text rendering
is only possible with Alpha enabled. Again, see SOE.hs from
the SOE package for sample usage.

GLFW doesn't work well with GHC threads, forkIO or threadDelay. 
So avoid them if you can.


======================
Additional Information
======================

You may send your bug report and feature request to the package 
maintainer: Paul H. Liu <paul@thev.net>.

Lastest GLFW development is hosted in a darcs repository. You
may obtain it by

  darcs pull http://code.haskell.org/GLFW

There is also a mailinglist for GLFW deveopers at 

  http://projects.haskell.org/cgi-bin/mailman/listinfo/glfw

--
Last Updated: Thu Oct 3 PST 2013