Skip to main content
GameDev.net gamedev.net
🔒 Locked

typecasting question

Started by Theses Jun 23, 2000 at 11:25 PM 0 replies 300+ views
Original Post
Theses
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
Shannon Barber
Shannon Barber
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.
The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.