• Advertisement

Archived

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

Quick Eazy Question,

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

What is the difference (in VC++) between float and GLfloat? I know that the values are the same, but does GLfloat get calculated with hardware or what? I mean, I dont see a point in having two variable types that do the same thing! thx

Share this post


Link to post
Share on other sites
Advertisement
typedef float GLfloat;
They are the same - on this particular architecture and this particular compiler. But they aren''t guaranteed to be the same everywhere else.

Share this post


Link to post
Share on other sites
They''re the same, but I dont know the reason why.

Just remember that all through the C language there are identical types with different names. char, byte and bool are all a single byte as well

Share this post


Link to post
Share on other sites
Yeah, and what about when your making functions, like:

void Render();

sometimes I see:

GLvoid Render();

Whats up with that? And GLint... just structures holding a int/whatever it may be?

"He who fights with monsters should look to it that he himself does not become a monster... when you gaze long into the abyss, the abyss also gazes into you..."~Friedrich Nietzsche

Share this post


Link to post
Share on other sites
so, should I use float or GLfloat?
does it make a difference?
is one more efficient?
does one get calculated on the GFX card as opposed to the processor?
hmm, well if u can answer, thn thx!

Share this post


Link to post
Share on other sites
so, should I use float or GLfloat?
does it make a difference?
is one more efficient?
does one get calculated on the GFX card as opposed to the processor?
hmm, well if u can answer, thn thx!

Share this post


Link to post
Share on other sites
Use GLfloat. There is absolutely no difference in performance, but you will ensure your code will remain portable.

Share this post


Link to post
Share on other sites
I see, thanks.
I dont need portability, but at least I know why its there.
I thought that mabey GLfloats were calculated by the hardware,
that would take the math load off hte processor, thadda be sweet!
but I guess thats something for the future of Geforce 3 eh?

Share this post


Link to post
Share on other sites
quote:
Original post by Martee
Use GLfloat. There is absolutely no difference in performance, but you will ensure your code will remain portable.


As long as you''re using C++, GLfloat will be no more portable than float.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
quote by masonium: As long as you''re using C++, GLfloat will be no more portable than float.

Actually the purpose is developmental portability. There might be a difference between Borland C++''s definition of int, and Visual C++''s definition of int, so the designers of OpenGL decided to make it easier for it''s users to develop using different compilers. Really a good idea given how many people develop over the internet.

-Brent Robinson

Share this post


Link to post
Share on other sites

  • Advertisement