Sign in to follow this  
henksgu

Noobs question about vertexbuffers

Recommended Posts

henksgu    122
Hi there! Apparently I have a problem, and I want your help, yes? Hmm, let me see. I have created 2 functions: IDirect3DVertexBuffer9 *CreateVertexBuffer(CVertex *vVertList, int iNumVerts); void DrawVertexBuffer(D3DPRIMITIVETYPE iType, IDirect3DVertexBuffer9 *pVB, int iNumPrimitives); I thought this was a really good idea, to create my VertexBuffer in the beginning of the program, and then use it in my render function without ever deleting it, provided that i won’t change it. But when I read through some of the text in the “DirectX 9.0 Programmer's Reference” looking for something, my eyes caught a glimpse of a text saying something about the vertexbuffer being stored in the video memory (the “pool”, I think) and then it came to my mind that maybe when I’m createing this buffer in the beginning it is stuck in the video memory somehow and wouldn’t come loose until I releaseed the buffer. Could someone explain this pool process in simple terms to me and give me some advice to how to handle my vertexbuffer, please!

Share this post


Link to post
Share on other sites
Telastyn    3777
Well yes, that's essentially correct. Do pVB->Release() to free the memory when you're done. [edit: though it may not be stored in video memory depending on the flags you pass to create the buffer]

As for proper use of vertex buffers... I'm still trying to learn myself.

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