Sign in to follow this  

CreateDevice affects floating point computation of Old C++ program

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

I have a very Old C++ program with floating point operations that do some rounding off of numbers. Adding a call to CreateDevice seems to give these operations a higher level of precision which screws up some rounding computations. Is there anything I do?

Share this post


Link to post
Share on other sites
look up

_control87
_controlfp
__control87_2

and other related floating point control functions (e.g., _fpreset) in your windows sdk help

Share this post


Link to post
Share on other sites
As AnAss implied, you need to pass the D3DCREATE_FPU_PRESERVE flag to CreateDevice. D3D changes the floating point state when you call CreateDevice, unless that flag is set, although using that flag will reduce performance.

Share this post


Link to post
Share on other sites

This topic is 3504 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this