I'd very much like to be able to do data-driven stuff with Cg shaders, making configurable parameter mappings with ranges read from CgAnnotations in the shader source.
I can iterate the parameters of an effect, and then iterate the annotations of each parameter and get their names and types... but not get the actual annotation values.
Given an annotation handle, its values may be retrieved through the use of one of the cgGet*AnnotationValues() entry points:
const float *cgGetFloatAnnotationValues(CGannotation, int *nvalues);
const int *cgGetIntAnnotationValues(CGannotation, int *nvalues);
const char *cgGetStringAnnotationValue(CGannotation);
const int *cgGetBooleanAnnotationValues(CGannotation, int *nvalues);
I haven't yet moved on from JOGL 1.1.1 for my main project, but I checked with JOGL-2 and the situation seems to be similar.
Presumably CgGL is implemented by GlueGen... Is there a particular reason these methods are not implemented? Can I help? I notice there no mention of these methods in http://download.java.net/media/jogl/builds/archive/jsr-231-2.0-beta10/logs/2009-09-15-win64build.log
, while other CgGL methods with similar names are there with warnings about unspecified buffer capacities that I'm sure devs are well aware of. I've never tried to build JOGL myself, and I'm not totally of-et with the build process.