Jump to content
  • Advertisement
Sign in to follow this  
arczev

OpenGL float and double

This topic is 4216 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi I'm not very practiced in OpenGL yet and I have little problem with lighting. Whenever I try to call glLightfv() function with numerical parameter like: glLightfv(GL_LIGHT0,GL_CONSTANT_ATTENUATION,4.0f);[\code] occurs following error: "Type mismatch in parameter 'params' (wanted 'const float *', got 'double')" What I'm doing wrong?

Share this post


Link to post
Share on other sites
Advertisement
glLightfv, the v at the end means it wants a pointer/array. So passing a constant value doesn't make any sense to it. If you want to pass a single value, use glLightf.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!