[ocaml-opengl] LablGL's Raw module

Florent Monnier monnier.florent at gmail.com
Wed Mar 13 19:15:19 GMT 2013


Hi,

Does someone knows why the module Raw has been written for LablGL
instead of using Bigarray's?

Is it just that bigarrays didn't exist yet when LablGL was first
written? Or is it for a better integration with the module API?

What do you think about this module?

IMHO it makes interoperability with other components, other libs more
difficult (but maybe the solution would only to externilise Raw from
LablGL) both related to the type system dependency, and/or we have to
copy to and from this data structure instead of just using ba's
everywhere while ba's are available from the base standard library.

For what I have experienced with ba's, their lack of sign/unsign
versions of each type is not really an issue, usually I just care to
know if the size of atoms are 8, 16 or 32 bits. The only problems I
got with ba's are that they are slow to allocate, and the interaction
with RAM is good, but the interaction with GPU memory is difficult:

When I try to wrap what is returned by glMapBuffer inside a BA I get segfaults
http://www.opengl.org/sdk/docs/man/xhtml/glMapBuffer.xml
so this is why there is currently a workarround for VBO's in glMLite with the
type mapped_buffer
and the functions:
- val glMapBufferAbs
- val mapped_buffer_blit

Also I've tried to use VBO with GLCaml, from a working vbo/hello-world
from glmlite i've tried to rewrite it for glcaml, but I was unable to
make it work. Does someone know if it's possible to use VBO's with
GLCaml?

-- 
Best Regards


More information about the OpenGL mailing list