I want to convert a array parameter like 'double [i]' to point like "const GLfloat *"
in Visual Studio 2008,and the array is "double [i][j]".
thanks help!
in Visual Studio 2008,and the array is "double [i][j]".
thanks help!
// You have an array of double's called "input"
// like double input[i];
// This is GLfloat *toConvertTo;
// with i data elements allocated
GLfloat toConvertTo[i];
// Probably don't need register. Use register with caution...
// Bad use of register can slow program down.
for (register int count = 0; count < i; ++count)
{
toConvertTo[i] = (GLfloat)input[i];
} // End for
// If passing to a parameter that takes in
// const GLfloat *, just pass toConvertTo
// and ignore making it a const.
const GLfloat *constConverteTo = toConvertTo;
Comment