Hi, i have little problem, i started to play with opengl/c++.
i got a code like:
Code:
glBegin (GL_TRIANGLES);
for(int i=0;i<sizeof(bodykit_face_indicies)/sizeof(bodykit_face_indicies[0]);i++){
for(int j=0;j<3;j++){
int vi=bodykit_face_indicies[i][j];
int ni=bodykit_face_indicies[i][j+3];
glNormal3f (normals[ni][0],normals[ni][1],normals[ni][2]);
glVertex3f (vertices[vi][0],vertices[vi][1],vertices[vi][2]);
}
}
glEnd ();
where bodykit_face_indicies is defined as :
Code:
static GLint bodykit_face_indicies[1921][6] = {.....}
that works perfectly, but i split big object into small gropus and now i want draw each of them, using fuction like this:
Code:
void draw(GLint array){
glBegin (GL_TRIANGLES);
for(int i=0;i<sizeof(array)/sizeof(array[0]);i++){
for(int j=0;j<3;j++){
int vi=array[i][j];
int ni=array[i][j+3];
glNormal3f (normals[ni][0],normals[ni][1],normals[ni][2]);
glVertex3f (vertices[vi][0],vertices[vi][1],vertices[vi][2]);
}
}
glEnd ();
};
and i want use it like :
Code:
draw(bodykit_face_indicies);
how i have to declare the variable array? couse for GLint ot GLint* return compiler errors:
for GLint:
invalid types `GLint[int]' for array subscript
for GLint*:
invalid types `int[int]' for array subscript
for GLint**:
cannot convert `GLint (*)[6]' to `GLint**' for argument `1' to `void draw(GLint**)'
thanks for any help/tips.