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 15:00:20 +0100 References: <20090107103951.bd36a6ba.mle+ocaml at mega-nerd.com> <200901070925.38869.fmonnier@linux-nantes.fr.eu.org> <20090107221831.df57cb6e.mle+ocaml@mega-nerd.com> In-Reply-To: <20090107221831.df57cb6e.mle+ocaml at mega-nerd.com> MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200901071500.21121.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 > > Also I have made an attempt to make a simili-functional opengl interface: > > http://www.linux-nantes.org/~fmonnier/OCaml/GL/doc/FunGL.html > > Ow, the colours on that page make it a little hard to read. hard to read for you. for me it's easier to read. my eyes just burn with white backgrounds. but you can change very easily the style of every ocamldoc doc: just change the .css style file, they are all compatible so you can take the .css file from another ocaml package and put it in the docs of ocaml-xlib or glMLite. alternatively you can remove the parameter "-css-style _style.css" in the Makefiles of these packages. > Is this an alternative to lablGL? There are 3 OCaml-OpenGL bindings: http://cocan.org/comparisons/gui#Bindings_to_the_OpenGL_3D_library - LablGL - GLCaml - glMLite LablGL is the older one, so people got used to it. I think you have already browsed the ocamldoc of LablGL, here are the ones for the two others : - http://www.linux-nantes.org/~fmonnier/OCaml/GL/doc/ - http://glcaml.sourceforge.net/doc/Glcaml.html > > and you can get a pixmap from a window. > > I was a bit stuck on how to do the second part. I imagine the process could be: (1) create the window (2) create the pixmap (3) copy from the window to the pixmap with xCopyArea: http://www.linux-nantes.org/~fmonnier/OCaml/Xlib/doc/Xlib.html#VALxCopyArea http://tronche.com/gui/x/xlib/graphics/XCopyArea.html but with the extention (see below) maybe the process is optimised > What I'm basically try to do is place 2D application windows in a 3D > space, much like SUN's Project Looking Glass: > > http://www.sun.com/images/k3/k3_lglass_gallery3.gif this is exactly to achieve this kind of things that I have written these bindings ;-) (well also to write screensavers in ocaml, a more simple thing to start with;) > and then handle mouse and keyboard events and pass them on down to > the 2D windows as required. yes the hard part is doing the math (not the C functions wrapped) but perhaps there is some freedom code arround from where to steal the formula > I tried to compile that with the shell script provied but got: > > Cannot find file GL.cma. install glMLite, or even without installing it, you can just open its tarball in /tmp run the make there, then from the ocaml-xlib dir run: cd /tmp wget \ http://www.linux-nantes.org/%7Efmonnier/OCaml/GL/download/glMLite-0.03.27.tgz tar xzf glMLite-0.03.27.tgz cd glMLite-0.03.27 make cd your/path/until/OCaml-Xlib/ make clean ; make Xlib.cma GLX.cma ocaml \ -I /tmp/glMLite*/SRC/ GL.cma Glu.cma \ -I . Xlib.cma GLX.cma \ pixmap_to_gl.ml > I am under the impression that I need glXBindTexImageEXT, > glXReleaseTexImageEXT and maybe some others. Ha I see, these functions don't appear in the base manual (I only read the manual until now), it is an extension : http://people.freedesktop.org/~davidr/GLX_EXT_texture_from_pixmap.txt I guess it provides an optimisation or usefull additional options, because the script "pixmap_to_gl.ml" already works, but doing real-time this way would perhaps be too slow. I see the functions of this extention are in my header, I will wrap it in the next days. Hey is your project an open-source project ? If it is the case you will guess that I could be interested :-) -- Regards Florent _______________________________________________ Lablgtk mailing list Lablgtk@yquem.inria.fr http://yquem.inria.fr/cgi-bin/mailman/listinfo/lablgtk