[Haskell-cafe] unsafeInterleaveIO and OpenGL

Henning Thielemann lemming at henning-thielemann.de
Fri May 9 17:05:04 EDT 2008

On Fri, 9 May 2008, Peter Verswyvelen wrote:

> I'm experiencing strange behavior when executing some Haskell OpenGL code 
> inside unsafeInterleaveIO.
> For example,
>       vp <- get GL.viewport
> returns garbage, as if the opengl context is not correctly set.

Sounds reasonable. 'unsafeInterleaveIO' defers computation of 'vp' until 
it is actually needed. At this time the viewport might have changed.

More information about the Haskell-Cafe mailing list