• Advertisement
Sign in to follow this  

Noobs question about vertexbuffers

This topic is 4921 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 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
Advertisement
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
Sign in to follow this  

  • Advertisement