[Haskell-cafe] renderString problems

Stuart Cook scook0 at gmail.com
Thu Aug 2 08:28:23 EDT 2007


On 8/2/07, Dave Tapley <dukedave at gmail.com> wrote:
> Using a BitmapFont I can get strings to appear but they demonstrate
> the odd behaviour of translating themselves a distance equal to their
> length every time my displayCallback function is evaluated.

I've never used OpenGL from Haskell, but it sounds like renderString
is modifying your modelview matrix with each call, presumably to make
it easier to chain lots of text together in one frame. Since the
matrix never gets reset, the translation effect accumulates each time
the scene is redrawn.

The quick fix would be to call loadIdentity (i.e. glLoadIdentity) each
time you update, before drawing anything.


Stuart


More information about the Haskell-Cafe mailing list