Whats TReal ???

Started by
6 comments, last by Bregma 14 years, 8 months ago
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
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.
TReal isn't a GL ES type, it's probably a typedef for some floating point type (float, double, long double, etc).
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
In the thread linked, "mag" refers to magnitude, or length.
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.
Thanks a lot for your help !!!!!
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.

Stephen M. Webb
Professional Free Software Developer

This topic is closed to new replies.

Advertisement