• Advertisement
Sign in to follow this  

Where to store my vertex buffer?

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

Hi, ive got the following setup: SceneManager |- <list>SceneObjects EntityManager |- <list>Entities GuiManager |- <list>GuiWindows Where should i keep the vertex buffers for these classes? In the parent class, then get each child to fill it in? Or store a static vertex buffer for all different types of GuiWindows, Entities etc?

Share this post


Link to post
Share on other sites
Advertisement
Hi there Skute,
How are you doing?

You have a couple of options, I guess this is more of a design problem then it is a DirectX problem.

[My opinions]
The Entity manager example
Let's take entity for example.
1) I assume you have an Entity class. If so you could store the VertexBuffer in the EntityManager and everytime you add an entity you could just add it's vertices to a dynamic buffer.

D3DUSAGE_DYNAMIC : "This is useful for drivers because it enables them to decide where to place the buffer. In general, static vertex buffers are placed in video memory and dynamic vertex buffers are placed in accelerated graphics port (AGP) memory."

2) You could have a static vertex buffer for each entity and just add the entity to the Entity Manager.

I hope these opinions help you somewhat to make a decision.
Take care.
PS: Someone with some more performance experience will probably come around soon.

Share this post


Link to post
Share on other sites
cheers thanks for that, think ill start planning to use the vertex buffer in the manager class

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement