HaskellWiki

Haskell | Wiki community | Recent changes
Random page | Special pages

 

Not logged in
Log in | Help

OpenGL

Categories: Packages

This is a stub page for Haskell's OpenGL and GLUT bindings. It is meant as a starting point to replace the outdated and misleading documentation at the old page.

First, note that the implementation is far more up-to-date than that old page suggested (originally, it was quite useful, but the page hasn't kept up with the implementation for a long time now).

Contents

1 References

In particular, note that the examples/ directory in the GLUT repo contains lots of examples, including translations of the red book examples.

Both the API documentation and the examples are best studied with the original specs and the original red book examples at hand. An index of the examples from v1.1 of the red book, with screen shots, can be found here

2 Projects using the OpenGL bindings

3 HOpenGL Resources

4 OpenGL Resources

5 Getting Started

6 Troubleshooting

6.1 I can't display text with renderString

It's probably because the text is displayed too big. Setting a much smaller scale factor before calling renderString should solve the problem.

scale 0.001 0.001 (0.001∷GLfloat)
renderString Roman "Test string"

6.2 Animations flicker

If you're not using DoubleBuffered display mode, turn that on. Also, you must set the display mode before creating the window you're going to be drawing in. To check if you've enabled double buffering use something like:

db <- get doubleBuffered

and set DoubleBuffered mode (before creating your windows!) like this:

initialDisplayMode $= [DoubleBuffered]
createWindow "My Window"

Retrieved from "http://haskell.org/haskellwiki/OpenGL"

This page has been accessed 7,874 times. This page was last modified 02:16, 11 May 2008. Recent content is available under a simple permissive license.