Programming optimizations

Started by
6 comments, last by Happy Thoughts 21 years, 10 months ago
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!
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
I personally use D3DX.
---visit #directxdev on afternet <- not just for directx, despite the name
When I look at the Quake2 source code I notice ID uses structs not classes - Is this a hint to what to use?
Nope. Quake II is in C. C doesn''t have classes.
Yeah and in Doom 3 carmack decided to go pure C++...
Yeah and in Doom 3 carmack decided to go pure C++...
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.

This topic is closed to new replies.

Advertisement