Qt samples error: ‘gluPerspective’ was not declared in this scope

error: 'gluPerspective' was not declared in this scope
compilando l'esempio QT 4.8 la funzione è obsoleta nelle GLUT
la si può rimpiazzare con:


void gluPerspective(double fovy,double aspect, double zNear, double zFar)
{
 // Start in projection mode.
 glMatrixMode(GL_PROJECTION);
 glLoadIdentity();
 double xmin, xmax, ymin, ymax;
 ymax = zNear * tan(fovy * M_PI / 360.0);
 ymin = -ymax;
 xmin = ymin * aspect;
 xmax = ymax * aspect;
 glFrustum(xmin, xmax, ymin, ymax, zNear, zFar);
}