Jump to content
  • Advertisement
Sign in to follow this  
disease332000

How much of my math classes should I inline?

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

The topic title says it all: How much of my math classes (like Matrix, Vector, Quat, etc) should I inline? Should I inline ALL of the functions, or only the simple ones? What is the point at which inlining a function becomes cumbersome?

Share this post


Link to post
Share on other sites
Advertisement
When I wrote my math library, I inlined every function except complex ones. By 'complex ones', I mean functions such as a matrix inverse function, or a function to build a view or projection matrix (because they're called very infrequently).

However, if this is for a Direct3D project, and you're not doing this just for the fun of it, I'd recommend using the D3DX library, since it's highly optimized.

Share this post


Link to post
Share on other sites
Yes i agree, use D3DX, its written for you :)

I would also like to add that the inline keyword is only suggestive. The compiler will choose how to implement ur code, but inlining it will tell the compiler how u would like it.

ace

Share this post


Link to post
Share on other sites
Thanks!
I'll keep that in mind. I'm actually using OpenGL, though, so no D3DX for meh.
Although I don't want to get into an argument with D3D coders -- OGL > D3D :P.

Share this post


Link to post
Share on other sites
If you have a few $ to spend, the first game programming gems book has a math lib ( at least matrixes ) on the cd which wasn't bad, iirc.

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!