Skip to main content
gamedev.net
🔒 Locked

Programming optimizations

Started by Happy Thoughts Jun 9, 2002 at 2:07 PM 6 replies 400+ views
Original Post
Happy Thoughts
Happy Thoughts
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!
Gammastrahler
Gammastrahler
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
IndirectX
IndirectX
I personally use D3DX.
---visit #directxdev on afternet <- not just for directx, despite the name
Happy Thoughts
Happy Thoughts
When I look at the Quake2 source code I notice ID uses structs not classes - Is this a hint to what to use?
ANSI2000
ANSI2000
Yeah and in Doom 3 carmack decided to go pure C++...
invective
invective
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.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.