Delivered-To: garrigue at math.nagoya-u.ac.jp Delivered-To: lablgtk at yquem.inria.fr From: Florent Monnier To: lablgtk at yquem.inria.fr Subject: Re: [Lablgtk] lablGL and GLX extentions? Date: Wed, 7 Jan 2009 09:25:38 +0100 References: <20090107103951.bd36a6ba.mle+ocaml at mega-nerd.com> In-Reply-To: <20090107103951.bd36a6ba.mle+ocaml at mega-nerd.com> MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200901070925.38869.fmonnier at linux-nantes.fr.eu.org> Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAAAXNSR0IArs4c6QAAAEhQTFR FAAAADAwMFBQUGxsbKioqOTk5SUlJV1dXZ2dneXl5g4ODi4uLmJiYpKSkq6urtLS0vLy8w8PDysr K1NTU29vb5eXl6+vr/v7+AIgcoAAAAjpJREFUSMedVgmCqyAMxQ1FkZ14/5v+CCixdkbnpy0Q4BG yUmaMxc/+NRYbLQuTya7Klh153TCzXSiuqQOIkAbGXdftDaCwCQvvWj4HHGr/CbB3gB1Yol6jhBc A37NCnf0CuF9pZCcNm30E6CqAsda6Z4BqK6CR9lEHLRkh4Z4Bpvtdwk3pOBAd/AvAJipgfOUHOO3 aww3gvobGVM6Hd57ezxHDINLKHaDjhbzEQI0AeDj2EZS9rhsmV0VJTqk7J8Wytxopz8vPK4G68ia kWSuV/yUfKGDftwwda3puflb6CjjM3Kl3Eqoje/cCEAKJxekZoONCAEN81iGSBNyD8W+Axv3HlR6 V9n9TGs06nfs7887T/ZmwLz29TW3DmrZX32Lpe/CFVSwWcsatqazr8jNKHHxizSJzoXc2vwErUx4 p7LkRAo7sEk5+H0jtKe91vhKsExem6hCWcVx8TVE780nGmg8q164hFIA4rJ4BwE8jZSutzRG+IQH GWrx3AJzVec4SXEfKOwIW6lkE8BpKKgFIpWMaFNBSGWywZHkEBNANeKS6FOPVxZks9wg3saUz22e 5j/wS3lgqgbw4jINWDdmw2DiR5S7lA82QGdTlyTI2Uok85QOd8RhL5A49mBCJRJGsBHXHvJu1ao1 mRLPWA9GzydO+IBqRPa3KpTqZPT0XGYM78iHOvGv6cT1iyU1D2wyTOWJJjX3TcRHIgwLeBSB/ToJ 3sSbQBsEVHq9kM7ncGllGZW7Vld3J/AM4rIig4nogMgAAAABJRU5ErkJggg== Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit > Hi all, Hi you, > I've done a bit of lablGL coding and found it a far superior way > of coding OpenGL in comparsison to doing it from C or Python. On which points? could you develop? Also I have made an attempt to make a simili-functional opengl interface: http://www.linux-nantes.org/~fmonnier/OCaml/GL/doc/FunGL.html I got no feedback yet about this rather experimental thing, and would be really interested to get some, to get an idea of the direction to make it evoluate. This module is currently glMLite compatible but it is rather independent from it. It would be very easy to make a LablGL compatible version. If you are interested to test/try it and tell me what you think about it, I would be happy to provide you a LablGL-compatible version. > I now need to be able to embed an X window on a surface in OpenGL > which I think requires GLX extensions (glxGetConfig, glxChooseVisual > etc). It is possible to compose a pixmap into an OpenGL texture, and you can get a pixmap from a window. And you can currently do all this from OCaml. This technique is explained here (for C): http://www.opengl.org/wiki/index.php/Programming_OpenGL_in_Linux:_Creating_a_texture_from_a_Pixmap It can be achieved from OCaml in exactly the same way. I have made an ocaml version of this demo program. This script is called "pixmap_to_gl.ml" in the Xlib-OCaml bindings here: http://www.linux-nantes.org/~fmonnier/OCaml/Xlib/ You will see that in fact you do not need GLX to achieve this, but only the Xlib module. This script also uses GLX but it's only for the windowing, you can switch it to Glut or SDL or something else. > Does lablGL support these GLX extentions (maybe the names have > changed)? LablGL only supports the OpenGL and GLU apis. It does not support windowing at all. Windowing is achieved with an additional module that you can choose, because there are no dependencies between the OpenGL modules and the windowing modules. You can choose LaglGlut, SDL, Togl (Tk), GLX. You could even use the Glut module from glMLite with LablGL, which supports the last Glut version which is named OpenGlut which provides enhancements and additionnal features. (but it stays compatible with the old outdated Glut) So to answer to your question, yes you can use LablGL with GLX: http://www.linux-nantes.org/~fmonnier/OCaml/Xlib/doc/GLX.html (there are still a couple of functions from the GLX api that are not wrapped yet, if you need those just ask) > Anybody working on supporting it? Google with the key words "ocaml GLX" would had give you this answer in first page. But indeed perhaps with less details than my email :-) The OCaml-Hump also provides the answer with the keyword "GLX" > Any example code? :-) There are several examples of use of GLX provided in the tarball: http://www.linux-nantes.org/~fmonnier/OCaml/Xlib/ All these examples use glMLite, but it's easy to switch from glMLite to LablGL, you can use the script named "glMLite_to_LablGL.sed.sh". You could also use this script to help converting from C to LablGL, while the function names of glMLite are kept from C. Hope this helps Florent PS: you are not on the LablGL mailing list but on the LablGTK one! _______________________________________________ Lablgtk mailing list Lablgtk@yquem.inria.fr http://yquem.inria.fr/cgi-bin/mailman/listinfo/lablgtk