Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using opengl with c++ builder 5

Status
Not open for further replies.

Leroy1981

Programmer
Jul 22, 2002
46
US
whenever i type in opengl to the help find thing it
comes up with only one topic on set8087cw talking about
floating point accuracy. is this really useful to do when
using opengl?
 
Seems its very important, its in the FPU control category.

Here are some FPU functions C++Builder has,

Default8087CW variable
Specifies the Default 8087 control word.

Get8087CW
Returns the value of the 8087 code word.

GetExceptionMask
Returns the exception mask from the FPU control word.

GetPrecisionMode
Returns the FPU precision control mode.

GetRoundMode
Returns the FPU rounding mode.

Set8087CW
Sets both the control word in the floating point unit and the variable NoErrMsg declared in the system unit.

SetExceptionMask
Sets the exception mask on the FPU control word.

SetPrecisionMode
Sets the FPU precision control mode.

SetRoundMode
Sets the FPU rounding mode.


Snippet from
When running floating point code, such as that found in Direct 3D, you will often get a series of floating point exceptions. Microsoft supporesses these exceptions by default, but we raise them. It is easy to turn this option off in both C++Builder


For OpenGL use Set8087CW(0x133f) to make sure floating point unit does not raise exceptions.

Example from C++Builder Help.
void NumericExample()

{
Word Saved8087CW = Default8087CW;
Set8087CW(0x133f); // Disable all fpu exceptions
ThirdPartyRoutine();
Set8087CW(Saved8087CW);
}


Some more info here,

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top