• Advertisement

Archived

This topic is now archived and is closed to further replies.

Programming optimizations

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

Does any body know what generates the fastest code in visual C++ 6.0 When you are optimizing a game so you use a vector classes or vector structs or can you program C++ classes to get the same speed as structs with inline functions. Any help on this topic would be great!

Share this post


Link to post
Share on other sites
Advertisement
i personally prefer vector classes implemented with C++.

i´ve noticed no performance drawbacks. try to avoid virtual methods that are called thousands or hundred thousands of times each frame.

and you should also avoid overloaded operators that return class structs.

use "call by reference" paramters whenever possible

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Nope. Quake II is in C. C doesn''t have classes.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Yeah and in Doom 3 carmack decided to go pure C++...

Share this post


Link to post
Share on other sites
If you are targeting windows, save yourself a bunch of time and use the D3DX math lib that comes with DirectX 8.1. You can link in the math library without the rest of DX, and it has lots of matrix, vector and quaternion functions and associated overloaded operators. All the functions are also SIMD accelerated for both Intel and AMD processors.

Share this post


Link to post
Share on other sites

  • Advertisement