Sign in to follow this  

[DX9] Vertex Management?

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

I'm fairly new to the DirectX 9.0c scene (only started programming DX yesterday). I was wondering how other people manage their vertex's? For example, if you were drawing three triangles, how would go about storing their VertexBuffers? an array? Thanks, Leo

Share this post


Link to post
Share on other sites
For the specific case of drawing just three triangles, I would place them in one vertex buffer.

Generally, game engines have a resource pool that holds all loaded stuff in it, so you don't have to actually load resources multiple times even though you would use them in many places. I personally would store whole object encapsulations - instances of classes that contain everything needed to render a particular kind of object - in the resource pool, but you should vary your approach based on actual needs of your game.

In C++, the best practice to store lists of any kind is to use the standard containers, such as std::vector or std::map. In D3D (and COM) the best practice is usually to use smart pointers that destroy the contained objects automatically when they go out of scope. Usually, combining these will generate best results.

Share this post


Link to post
Share on other sites
It is not practical to handle individual vertices in a resource pool manager.

If your intention is just to store a small amount of vertices, create a single vertex buffer in the same module that you do your drawing in.

Share this post


Link to post
Share on other sites

This topic is 3115 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this