Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[Caml-list] [ANN] glMLite

13 views
Skip to first unread message

Florent Monnier

unread,
Dec 23, 2007, 4:58:07 PM12/23/07
to OCaml
OCaml bindings for OpenGL.

http://www.linux-nantes.org/~fmonnier/OCaml/GL/


(Samples from the Red-Book translated to OCaml are provided.)

You can have a look at the interface generated documentation here:
http://www.linux-nantes.org/~fmonnier/OCaml/GL/doc/

--
Regards

_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

Stefano Zacchiroli

unread,
Dec 24, 2007, 3:55:32 AM12/24/07
to Inria Ocaml Mailing List
On Sun, Dec 23, 2007 at 10:57:33PM +0100, Florent Monnier wrote:
> OCaml bindings for OpenGL.

Can you please compare glMLite with LablGL [1]?

Cheers.

[1] http://wwwfun.kurims.kyoto-u.ac.jp/soft/olabl/lablgl.html

--
Stefano Zacchiroli -*- PhD in Computer Science ............... now what?
zack@{cs.unibo.it,debian.org,bononia.it} -%- http://www.bononia.it/zack/
(15:56:48) Zack: e la demo dema ? /\ All one has to do is hit the
(15:57:15) Bac: no, la demo scema \/ right keys at the right time

Jan Rehders

unread,
Dec 24, 2007, 8:35:23 AM12/24/07
to caml...@yquem.inria.fr
On 24.12.2007, at 09:54, Stefano Zacchiroli wrote:

> On Sun, Dec 23, 2007 at 10:57:33PM +0100, Florent Monnier wrote:
>> OCaml bindings for OpenGL.
>
> Can you please compare glMLite with LablGL [1]?

.. and glcaml [2] :)

> [1] http://wwwfun.kurims.kyoto-u.ac.jp/soft/olabl/lablgl.html

[2] http://glcaml.sourceforge.net/

Florent Monnier

unread,
Dec 24, 2007, 11:19:17 AM12/24/07
to Inria Ocaml Mailing List
Hi,

> > OCaml bindings for OpenGL.
>
> Can you please compare glMLite with LablGL [1]?

I can't since LablGL doesn't work on my computer (Mandriva and Mesa).
That's the reason why I did my own binding.
All I can say is that LablGL has a more camlize interface while my binding
keeps the openGL function names unchanged. (but a wrapper module makes it
possible to use glMLite with LablGL's interface, and by the way it is
possible to run Lablgl scripts with glMLite.)
When the problem with LablGL was uncountered I have mailed the author, but we
have not been able to find the reason of the problem with LablGL, so...

Cheers

Florent Monnier

unread,
Dec 24, 2007, 11:29:12 AM12/24/07
to caml...@yquem.inria.fr
Hi,

> > Can you please compare glMLite with LablGL [1]?
>

> ... and glcaml [2] :)

I have never used glcaml.
When I have begin my binding, glcaml was not release yet, so that's why I
begun my own.
What I can say as difference from reading the generated documentation is that
each of the 3 openGL binding resolve the problem of the GLenum parameters
(that often collide between several functions) in a different way.
GLCaml provides one big glenum type that contains all the parameters for all
the functions (so it seems there is no type check at all), LablGL uses
polymorphic variants, and glMLite packs the problematic types in modules.
So users have the choice :)

--
Regards

Jon Harrop

unread,
Dec 27, 2007, 8:31:41 PM12/27/07
to caml...@yquem.inria.fr
On Monday 24 December 2007 13:34:51 Jan Rehders wrote:
> On 24.12.2007, at 09:54, Stefano Zacchiroli wrote:
> > On Sun, Dec 23, 2007 at 10:57:33PM +0100, Florent Monnier wrote:
> >> OCaml bindings for OpenGL.
> >
> > Can you please compare glMLite with LablGL [1]?
>
> ... and glcaml [2] :)

While we're on the subject, perhaps I can productively compare LablGL and
GLCaml:

LablGL is by far the most widely used and, therefore, tested of the OpenGL
bindings available for OCaml. According to the package popularity contests,
LablGL has 412 registered installs on Debian and Ubuntu. This library is
ideal for people who are less familiar with OpenGL because it provides a
higher-level and safer API. However, LablGL only supports OpenGL 1.

GLCaml are the most up-to-date bindings to OpenGL for OCaml, supporting the
latest OpenGL 2 API. This library uses an OCaml program to generate the
bindings automatically, which makes it much easier to keep up to date but
lower-level. This library is ideal for people who require OpenGL 2 but is not
as thoroughly tested as LablGL (no packages) and, consequently, contains
bugs.

I'm not quite sure where Florent's bindings fit in because they lack packages
and users like GLCaml and lack support for OpenGL 2 like LablGL.

I recently wrote several OpenGL 2 shader demos in OCaml using Elliott Oti's
GLCaml bindings. I filed two bug reports in the process. I'm hoping the
community can pull together to get these state-of-the-art bindings tested and
shipped in deb packages. I'd like this to be the future of OpenGL for OCaml
because the autogenerated bindings make the latest OpenGL features accessible
to expert users and higher-level bindings can easily be written to help
newbie users.

We'll refrain from writing OCaml Journal articles about GLCaml until it has
stabilized but several people have expressed an interest in a 3D scene graph
library for OCaml which I can create for GLCaml easily from part of Smoke's
source code.

--
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/products/?e

Florent Monnier

unread,
Dec 29, 2007, 4:22:11 PM12/29/07
to caml...@yquem.inria.fr
> I'm not quite sure where Florent's bindings fit in because they lack
> packages and users like GLCaml and lack support for OpenGL 2 like LablGL.

I mainly did it for my own usage,
and I provide it in case it could be usefull for other people.

And while I wrote a module to use glMLite with LablGL's interface, I've
discovered bugs both in glMLite and in LablGL: for exemple in LaglGL
eval_coord2 was wrapped to glEvalCoord1d in stead of glEvalCoord2d.


> I recently wrote several OpenGL 2 shader demos in OCaml

If your OCaml-OpenGL demos are available on the web, I would be well
interested to get those.
(Or if they are not, maybe you could send in email.)

--
Best Regards
Florent

Jon Harrop

unread,
Dec 30, 2007, 1:45:40 AM12/30/07
to caml...@yquem.inria.fr
On Saturday 29 December 2007 21:20:48 Florent Monnier wrote:
> > I recently wrote several OpenGL 2 shader demos in OCaml
>
> If your OCaml-OpenGL demos are available on the web, I would be well
> interested to get those.
> (Or if they are not, maybe you could send in email.)

Yes, I suspect quite a few people would like these demos. I'll put them up on
our site ASAP.

Essentially, OpenGL 2 lets you do per-pixel lighting from OCaml really easily
and the results look absolutely fantastic: much better than OpenGL 1. You can
also do much more sophisticated things (like the Mandelbrot shader I've got
working) but its the basics that I really appreciate.

GLCaml makes this about as easy as it can be, although there are a couple of
places where I'd like the types to be different. For example, I'd prefer
strings instead of byte bigarrays for everything from shaders to variable
names.

In summary, there's no reason for OCaml programmers to restrict themselves to
OpenGL 1, at least not after Elliott fixes the minor bugs I found.

--
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/products/?e

_______________________________________________

0 new messages