2
votes

I am trying the tutorial on OpenGL 3.3 as presented : http://www.opengl-tutorial.org/beginners-tutorials/tutorial-3-matrices/

It says a projection matrix can be created with GLM as :

glm::mat4 Projection = glm::perspective(45.0, 4.0/3.0, .1, 100.0 );

However, as I try to compile my code, with it, I get the following error:

 error: conversion from ‘glm::detail::tmat4x4<double>’ to non-scalar type ‘glm::core::type::mat4 {aka glm::detail::tmat4x4<float>}’ requested
make: *** [src/main.o] Error 1

What could be wrong?

1

1 Answers

4
votes

You are passing a double try passing float arguments instead.

glm::mat4 Projection = glm::perspective(45.0f, 4.0f/3.0f, .1f, 100.0f );