Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Theses

typecasting question

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

i''m just wondering for any function say for example here glColor3f which has 3 parameters all floats now for the question is there any difference between glColor3f(1.0, 1.0, 1.0); and glColor3f(1.0f, 1.0f, 1.0f); or in other words does this promotion to double have any effect on the first one

Share this post


Link to post
Share on other sites
Advertisement
quote:
Original post by Theses

i''m just wondering for any function say for example here
glColor3f
which has 3 parameters all floats
now for the question
is there any difference between
glColor3f(1.0, 1.0, 1.0);
and
glColor3f(1.0f, 1.0f, 1.0f);
or in other words does this promotion to double have any effect on the first one


Depends on the compiler, if it sticks to its guns, the first one will store the 1.0''s as doubles in ram, and convert them to floating points before each function call (SLOW!)- the second one will just call the funcion with the fp values.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!