I\'m trying to read some OpenGL tutorials on the net. the problem is that I found some old ones that use gluPerspective(). gluPerspective was deprecated in Open
Use GLM.
glm::mat4 projection = glm::perspective(
// FOV & aspect
60.0f, 16.0f / 10.0f,
// Near and far planes
0.001f, 1000f);
// If you're using the now deprecated matrix stacks
glMatrixMode(GL_PROJECTION);
glLoadMatrixf(glm::value_ptr(projection));
// if you're using the new shader based pipelines
GLint projectionUniformLocation = ...;
glUniformMatrix4fv(projectionUniformLocation, 1, GL_FALSE,
glm::value_ptr(projection));
Note, if you have GLM_FORCE_RADIANS defined then you should use radians in the perspective function, not degrees...
glm::mat4 projection = glm::perspective(
// FOV & aspect
PI / 3.0f, 16.0f / 10.0f,
// Near and far planes
0.001f, 1000f);