[Fieldtrip] Re: Bug #21 - patch

7 views
Skip to first unread message

Conal Elliott

unread,
Jul 6, 2010, 1:03:41 PM7/6/10
to Maciej Piechotka, fieldtrip
Hi Maciej,

I was cleaning up my email and discovered that I hadn't applied your patches (to FieldTrip and reactive-glut) or even responded to you.  My apologies!  And thanks for your efforts.

I just read through your FieldTrip patch, and it looks like you changed FieldTrip's interface to use OpenGL floats instead of Haskell Float & Double.  I'm reluctant to shift in that direction, as I would like OpenGL to end up completely hidden behind an elegant, Haskell-centric interface.  My initial attempts to stay with Haskell types failed, due to a strange lack of exporting of some methods in the OpenGL library (preventing me from making instances for Float and Double).  I've emailed Sven repeatedly about the issue, but his focus is elsewhere.  Perhaps if he hears from others as well.

I'd appreciate any other ideas for getting unstuck here.

Regards,  - Conal

On Mon, Jun 7, 2010 at 11:12 AM, Maciej Piechotka <uzytk...@gmail.com> wrote:
I'm sorry for sending it on priv but I don't have rights to add patch
and the comment messed up with whitespace.

Patch making FieldTrip compatible with OpenGL 2.4. Additionally
strickten of requirements is added (it should be done as there is no
guarantee library are backward compatible).

Regards

Nikolay Orlyuk

unread,
May 19, 2012, 2:27:50 AM5/19/12
to fieldtri...@googlegroups.com, Maciej Piechotka, fieldtrip
Hello

Looks like I hit the same situation. Made some patch to get it compiled rather than thinking a bit deeply.

First time I found this post I thought "Probably that's true that we should support Haskell types". But after some googling through "why OpenGL want to use GLfloat" etc I found http://www.glprogramming.com/red/chapter01.html

From one side that's responsibility of OpenGL hackage to do mapping of types. And if Float matches to the GLfloat why not to have it as ColorComponent. Use some OpenGLMapped with (toGL :: MappedGLType a -> a) and fromGL.
But from the other side we'll have here too much implicit actions done behind the scene. That may cause conversion back and forth while client library may handle this better (by using GL types at some earlier steps).
Since FieldTrip itself is tightly related with OpenGL it should provide similar interface that OpenGL do. I.e. allow client library to decide which type it want to use for transformation etc. We can't use Float or Double since their implementation might change to something that will require conversion to GL types and thus clients that will want to be as close to OpenGL as possible will not notice that.

Looks like this library doesn't get proper support since OpenGL-2.3.0.0 (when Data.Tensor was extracted).
I may try to move out this conflict of types from library itself if that makes sense.

Thank you
Reply all
Reply to author
Forward
0 new messages