Sign in to follow this  

Where to store my vertex buffer?

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
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

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