Dear OCaml user, I am please to annouce a first alpha release of gles3 for OCaml. These are lightweight bindings for gles3, a join work with Alexandre Miquel. The package should be in the opam repository soon. URLs: http://lama.univ-savoie.fr/~raffalli/gles3/ http://lama.univ-savoie.fr/~raffalli/gles3/gles3-050316.tar.gz This is also a call for contributions, mainly: - to test and debug - port the egl.ml file to other platforms than linux/EGL/X11 (windows, OSX, linux/wayland, ios, android, ...) Cheers, Christophe Raffalli -------------------------------------------------------------------- [1]OCaml [2]GLES 3.0 bindings examples with shadows Introduction This project aims at providing a portable way to do OpenGL (precisely GLES) application using OCaml. It comes in three parts: * Low level bindings which allow to call directly GLES functions. This binding tries to be reasonably type-safe using polymorphic variants to encode Glenum type. The low level bindings also provide some sanity checks for the size of bigarrays which allow to capture quite a lot of errors with clear messages. * High level bindings: to provide some auxiliary functions like matrix inversion and ease the development. For instance, to use shaders, with the high level bindings, you use compile_shader with the sources code, get a value of type unit program. Then, you can set the variables of the shaders (uniform or attributes), either as constant or function and get a function to finally run the shaders. * A way to open a window, start the main loop and interact. Currently only EGL under X11 is supported but it would be nice to have support for other platforms (windows, OSX, android, ios, wayland, ...) with exactly the same interface. Authors * [3]Alexandre Miquel (initial low level bindings for GLES 2) * [4]Christophe Raffalli (partial port to GLES 3.0, high-level bindings and examples) Documentation * [5]Generated html from the MLI files * the examples: [6]examples/testa_gles.ml: a rotating cube [7]examples/testb_gles.ml: a rotating cube with a texture [8]examples/testc_gles.ml: 7 rotating cubes with simple shadow mapping [9]examples/testd_gles.ml: 7 rotating cubes and 8 implicit surfaces with simple shadow mapping TODO (please contribute !) * test and fix bugs ! * documentation * complete the low-level bindings * develop the high-level bindings guided by more examples * provide support for more platforms (see introduction) * find a way to support multiple version of GLES (at least 2.0, 3.0, 3.1) with only one OCaml library, and possibly in a transparent way when using the high-level bindings (i.e., the high lebel bindings should test the version and make the best choice) * collect regexp for error message in GLSL for most GLES vendors to give good error messages in all cases (only one vendor, nouveau/mesa supported currently). This is a pity that GLES does no define a standard at least for position in error messages. * ... Known bugs * Mixing vertex arrays and buffer seems not to work (but no error flag are positionned), for instance, vertex in a buffer and normal in an array result in wrong normals. One shoud check this on a C program... * Textures are not yet garbage collected ... should be fixed soon Références 1. http://caml.inria.fr/ 2. https://www.khronos.org/registry/gles 3. https://www.fing.edu.uy/~amiquel/ 4. file:///~raffalli 5. file:///home/raffalli/Caml/gles3/main.html 6. file:///home/raffalli/Caml/gles3/repos/examples/testa_gles.ml 7. file:///home/raffalli/Caml/gles3/repos/examples/testa_gles.ml 8. file:///home/raffalli/Caml/gles3/repos/examples/testa_gles.ml 9. file:///home/raffalli/Caml/gles3/repos/examples/testa_gles.ml