I was wondering, if I make a display list and call something like when I'm creating the display list:
CGparameter param = cgGetNamedParameter(prog,name.c_str());
Will it be saved into the display list? I figure the cg library is going to call opengl commands that should be captured?
This relates to a problem I'm having. That is, I read in a .obj file. Every group in the file I make a display list. But within each group there can be multiple materials/colors from the mtl file. So, as I generate a triangle strip for instance, the colors might change. Unfortunately, when I run the cg fragment program it tends to take into account the first and second material but if I have more it just runs that material over the rest of the triangles. I get the material info from glstate.material.diffuse , for instance. I assume the glstate was set by glMaterialfv when I created my list.
When I run the exact same display lists in plain opengl ( without cg ) then I get the proper colors generated glMaterialfv.
I'm wondering if I should call cgGLSetMatrixParameterfr explicitly and set a variable in the cg program rather than using glstate?