Noobs question about vertexbuffers

Started by
0 comments, last by Telastyn 19 years, 8 months ago
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!
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.

This topic is closed to new replies.

Advertisement