Jump to content
  • Advertisement
Sign in to follow this  
Anddos

float error that i cant fix, (d3d9 related)

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

d3dUtil.h(90): error C2062: type 'float' unexpected
d3dUtil.h(108): warning C4056: overflow in floating-point constant arithmetic RenderToTexDemo.cpp

 

const float INFINITY = FLT_MAX;

float.h has

 

#define FLT_MAX         3.402823466e+38F        /* max value */

 

this is the source code link

 

http://www.d3dcoder.net/Data/Book2/PartIII.zip, its the RenderToTex sample inside the chapter 21 folder

 

the compiler i am using is vs 2013, i remember compiling this before with vs2010 with no issues, can anyone help?

Edited by Anddos

Share this post


Link to post
Share on other sites
Advertisement

The name "INFINITY" is probably already defined as something else (like in Windows.h or D3D9.h). Just use FLT_MAX instead of renaming it.

Also, "infinity" is a bad name for it, as they are not the same thing and you can do for example FLT_MAX / 2 and get a new number that is no longer FLT_MAX.

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!