Quick question.
Is there a way to pass an int in c++ into a openGL function that is looking for a GLint??
example I am trying to pass an int to
Where faces is a vector of ints and faceLoop is an integer.Code:glVertex4iv(faces.at(faceLoop));
Printable View
Quick question.
Is there a way to pass an int in c++ into a openGL function that is looking for a GLint??
example I am trying to pass an int to
Where faces is a vector of ints and faceLoop is an integer.Code:glVertex4iv(faces.at(faceLoop));
I'm pretty sure GLints and GLfloats are just typedef's for ints and floats. You can pass an int where it expect a GLint and you can pass a float where it expects a GLfloat (and so on with other OpenGL types). I could be wrong though. If just passing it doesn't work, then perhaps try casting it.Code:glVertex4iv((GLint)faces.at(faceLoop));
If you don't have the prototype for that function (ie, the right header file) then it might not have an implicit cast.
glVertex4iv takes an array. Lucky you, vector memory is guaranteed to be contiguous. 100% guaranteed mofckyug, you hear dat?!
Or if the 4 ints you want to pass are not at the start of the vectorCode:glVertex4iv(&faces.at(0));
glVertex4iv(&faces[0]);
glVertex4iv(faces.begin());
Code:glVertex4iv(&faces.at(index));
glVertex4iv(&faces[index]);
glVertex4iv(faces.begin() + index);