Jump to content
  • Advertisement
Sign in to follow this  
basil_fawlty

OpenGL Whats TReal ???

This topic is 3265 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´ve been reading a post here reacently. It´s about implementing gluLookAt() in Opengl Es. I have to implement the same, but in "normal" opengl. Now my question is what is the equivalent of opengl es´s TReal in OpenGl. I was searching on google but found nothing. I suspect it might be float or double, but wanted to be sure. So thanks for your answers Cheers Here is the link to the thread: http://www.gamedev.net/community/forums/topic.asp?topic_id=311555

Share this post


Link to post
Share on other sites
Advertisement
As far as I know "Real" is just the collection name of floating point types. It could be a float, double or even larger floating point types, depending on implementation.
So I guess it all comes down to what kind of precision you need.

Share this post


Link to post
Share on other sites
TReal isn't a GL ES type, it's probably a typedef for some floating point type (float, double, long double, etc).

Share this post


Link to post
Share on other sites
Thanks Lads,

that was helpful. Now I have another question. Maybe one of you can answer that as well.
There are the two variables fMag and upMag.
Where do they come from and what do they mean?
They are not initialized anywhere.
The suffix Mag seems to mean something in Opengl es.
But I dont know what it could be.

Maybe someone could enlighten me.

Would be much appreciated

Cheers

Share this post


Link to post
Share on other sites
I'd imagine what its actually hiding/encapsulating there is a switch between floating-point and fixed-point maths. I'm getting that feeling as OpenGL ES is often used on things like small handheld devices that can't handle floating point calculations too well, if at all (they may not have an FPU).

http://en.wikipedia.org/wiki/Fixed-point_arithmetic

If you're just running a normal opengl pc build, a regular float will do just fine now, unless you intend on moving to a fixed-point machine in the future.

Share this post


Link to post
Share on other sites
Quote:
Original post by Westie007
I'd imagine what its actually hiding/encapsulating there is a switch between floating-point and fixed-point maths. I'm getting that feeling as OpenGL ES is often used on things like small handheld devices that can't handle floating point calculations too well, if at all (they may not have an FPU).


I would image that's it. ALthough "TReal" has nothing to do with OpenGL ES, it's posible someone had defined a typedef (like the TCHAR in WIN32) so that the same code could be used with either profile of OpenGL ES 1.

OpenGL ES 1 supports two incompatible profiles: the Lite profile supports only fixed-point values, the Common profile supports only float values. OpenGL ES 2 is of course completely incompatible so the same code will not compile for both OpenGL ES 1 and 2 regardless of what define or typedef you use.

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!