PDA

View Full Version : structs and function-declaration



toneburst
01-04-2010, 05:28 AM
If I declare a couple of c-style structs like so:

struct TRIANGLE {
float4 p[3];
};
struct GRIDCELL {
float4 p[8];
double val[8];
};
and then attempt to use an input/output variable of that type in a function, like this

int Polygonise(GRIDCELL grid, double isolevel, TRIANGLE *triangles) {
int i, ntriang;
int cubeindex;
float4 vertlist[12];
}
I get an error about an expected ')' character. I imagine this is just a syntax issue, but I can't find anything in the documentation covering this exact scenario. The code I'm working on is a version of Paul Bourke's Marching Cubes source http://local.wasp.uwa.edu.au/~pbourke/geometry/polygonise/, originally written in C.

Any tips much appreciated.

a|x