Advertisement

Help with gluPerspective Tutorial ONE

Started by November 10, 2003 04:24 PM
1 comment, last by Mat1515 21 years, 3 months ago
Hey ive been trying to fingure out what (GLfloat) does in this code?

GLvoid ResizeGLScene(GLsizei width, GLsizei height)
{
	if (height==0)
	{
		height=1;
	}

	glViewport(0,0,width,height);

	glMatrixMode(GL_Projection);
	glLoadIdentity();

	gluPerspective(45.0f,(GLfloat)width/(GLfloat)height,0.1f,100.0f);//THIS LINE!!!


	glMatrixMode(GL_MODELVIEW);
	glLoadIdentity();

}
THANKS!
Ut o not me again:) lol
It prevents truncation due to integer division.

[twitter]warrenm[/twitter]

Advertisement
Yep, thats a c-style static cast, meaning that it tells the compiler to treat it as a GLfloat

This topic is closed to new replies.

Advertisement