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 :
My question is how do I get the value of colorEntryList -> position and color when in do a for loop:Code:typedef struct { int i_colorEntryList; int n_colorEntryList; struct colorEntryList_s { miScalar position; miColor color; } colorEntryList[1]; } ar_ramp_t;
when I generated the code from the mi declaration file I made, it included the line :Code:DLLEXPORT miBoolean ar_ramp( miColor *result, miState *state, ar_ramp_t *param) { int i_colorEntryList = *mi_eval_integer(¶m->i_colorEntryList); int n_colorEntryList = *mi_eval_integer(¶m->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; }
but I can not find much useful reference on how this would be used?Code:struct colorEntryList_s *colorEntryList = (struct colorEntryList_s *)mi_eval(state, param->colorEntryList);
Any help would be much appreciated;
-Ash


Reply With Quote