Jump to content
  • Advertisement
Sign in to follow this  
fosh

OpenGL GLdouble vs double

This topic is 4974 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

So i want to use my generic libraries in an opengl program, for vectors and matrices and what not. Thing is, all doubles are declared 'double', not GLdouble, and it spams me with warnings whenever i dont typecast when calling gl functions and passing doubles, not GLdoubles. Typecasting everywhere is ugly. Is there any way to stop the compiler bitching about this, considering GLdoubles just seem to be typedef'd doubles? cheers, Scott

Share this post


Link to post
Share on other sites
Advertisement
the compiler might have an option to switch off that warning, however that means you'll lose warning for ALL conversions like that.

Also, as a side point, doubles arent the best format to feed the graphics card, they much prefer floats and you could be trashing your performance in the long run.

Share this post


Link to post
Share on other sites
:O
seriously?
is that because the cards only do floating point in hardware, and have to split doubles into a couple of operations or something?

Share this post


Link to post
Share on other sites
Quote:
Original post by fosh
:O
seriously?
is that because the cards only do floating point in hardware, and have to split doubles into a couple of operations or something?


yep, they do only act on floating point in hardware and have to convert doubles down to floats (64bit down to 32bit iirc) to use them. So you are using twice the space and probably losig performance.

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!