unsafeInterleaveIO and OpenGL

View: New views
3 Messages — Rating Filter:   Alert me  

unsafeInterleaveIO and OpenGL

by Peter Verswyvelen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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.

Is this to be expected? Or is it likely a bug on my side?

Thanks,
Peter



_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@...
http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: unsafeInterleaveIO and OpenGL

by Henning Thielemann :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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.
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@...
http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: unsafeInterleaveIO and OpenGL

by Peter Verswyvelen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


> Sounds reasonable. 'unsafeInterleaveIO' defers computation of 'vp'
> until it is actually needed. At this time the viewport might have
> changed.
That sound reasonable indeed, but the viewport does not change and the
values I get are really random. I'll try to make minimal example to
demonstrate the problem.

Thanks,
Peter

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@...
http://www.haskell.org/mailman/listinfo/haskell-cafe