Hi all,

I may be going out of my depth but I'm trying to make a ramp based shader where the main struct line looks like this :

Code:
typedef struct {
	int		i_colorEntryList;
	int		n_colorEntryList;
	struct colorEntryList_s {
		miScalar	position;
		miColor		color;
	} colorEntryList[1];
} ar_ramp_t;
My question is how do I get the value of colorEntryList -> position and color when in do a for loop:

Code:
DLLEXPORT miBoolean ar_ramp(
	miColor *result,
	miState *state,
	ar_ramp_t *param)
{

	int i_colorEntryList = *mi_eval_integer(&param->i_colorEntryList);	
	int n_colorEntryList = *mi_eval_integer(&param->n_colorEntryList);	

miScalar pos;
miColor col;
int i;

	for (i=0; i < n_colorEntryList; i++) {		
		// get position
		pos = *mi_eval_scalar(param->colorEntryList + i_colorEntryList + i)->position;
		// get color
		col = *mi_eval_color(param->colorEntryList + i_colorEntryList + i)->color;
	}
when I generated the code from the mi declaration file I made, it included the line :

Code:
	struct colorEntryList_s *colorEntryList = (struct colorEntryList_s *)mi_eval(state, param->colorEntryList);
but I can not find much useful reference on how this would be used?

Any help would be much appreciated;

-Ash