I started a project with the goal to provide access to native data (ByteBuffer) through an interface provided by the application.
You probably know the hassle to write wrappers around byte buffers to access uniform blocks or data in vertex array buffers and such. Writing the same kind of code over and over makes me sick and since I have a lot of experience in code generation, I decided to put an end to it.
The idea is roughly this: You just write a class skeleton (similar to RMI for example) which you provide to a class generator at runtime. The class generator adds required functionality and information in a derived class and gives you an instance of that class to access. This instance then acts as the interface to the native data.
This will all happen at runtime, so there is no visible preprocessing step involved in your build process. It doesn’t have to be at runtime, but it is possible and so most people will use it that way.
This sounds just like a tiny advantage, I know, but the bigger picture, is this: Meta information about types in data is needed at different places. Besides just accessing the data in a byte buffer, you can use the same meta-information provided by the class to declare the format of meshes, and then use the same information again to associated appropriate vertex attributes or even define them already in the class as annotations. Same for uniforms: You can identify the appropriate uniform variable in the shader using the name of the member variable or an annotation again … and so on. It makes the whole thing more consistent.
If anybody is interested in the progress or first prototypes, here is the address: http://homac.cakelab.org/projects/org.cakelab.nio/
EDIT: I’ve reviewed existing approaches related to this topic: http://homac.cakelab.org/projects/org.cakelab.nio/existing.html
EDIT(22.03.17): Major change of approach after detailed analysis: http://homac.cakelab.org/projects/org.cakelab.nio/current.html
EDIT(30.04.17): First release (beta): http://homac.cakelab.org/projects/org.cakelab.nio/