[clean-list] OpenGL

Arjen van Weelden A.vanWeelden at cs.ru.nl
Mon Feb 27 09:25:44 MET 2006


Hi Jeff,

I wrote some preliminary Clean binding for OpenGL myself. You can 
download them from my website:
http://www.cs.ru.nl/A.vanWeelden/index.php?p=downloads

It uses the Win32 API to create the rendering context (written in C), 
but it shows the use of Clean's FFI to call OpenGL functions. It does 
not use callbacks from C to Clean, which you would probably like for 
more advanced programs or bindings to GLUT.

I have made an attempt to mimic Haskell's FFI in Clean to support such 
call-backs and some other useful things such as MVars, marshalling, 
(foreign) pointers, and stable pointers. It is also available from my 
website. This work has been much inspired by Diederik's work on the 
Apple platform.

Combined together, I hope that these two unfinished examples (without 
documentation, of course) will give you enough information to write 
OpenGL bindings in Clean. Although I not have same amount of time and 
energy as you do, I will try to help.

best of luck,
	Arjen

Jeff Ervin wrote:
> Thanks Diederik, I was hoping someone had already done some work that 
> would serve as a guide for me. I would appreciate if you or Arjen could 
> make your  work available  when you  have time to look for it. If I can 
> see how to do it, I have the time and energy to do a full binding.
> 
> Regards,
> 
> Jeff Ervin
> 
> Diederik van Arkel wrote:
> 
>> Hi Jeff,
>>
>> yes this is possible with the current ffi although I can't remember of 
>> hand if
>> you might need some undocumented features. I've started on a binding 
>> once or twice
>> and I know Arjen van Weelden has done a little work on it as well. 
>> Neither of us
>> got very far. The problem is mainly that OpenGL has a very large API 
>> and we didn't
>> have the time and energy to produce a full binding.
>>
>> Once I recover from my cold I'll look if I can find my old experiments 
>> and ask Arjen
>> if he can find what he has produced (if he doesn't already reply 
>> himself).
>>
>> Regards and good luck,
>>
>> Diederik van Arkel
>>
>> P.S. I'll check with Arjen if maybe we can help a bit producing a 
>> binding,
>> although I have little time these days.
>>
>> On Feb 25, 2006, at 5:42 AM, Jeff Ervin wrote:
>>
>>> Has anyone ever attempted an OpenGL binding for Clean? Is the foreign 
>>> function interface for Clean sufficient for something like this?
>>> _______________________________________________
>>> clean-list mailing list
>>> clean-list at science.ru.nl
>>> http://mailman.science.ru.nl/mailman/listinfo/clean-list
>>>
>>
>>
> _______________________________________________
> clean-list mailing list
> clean-list at science.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/clean-list


More information about the clean-list mailing list