#define D3DFVF_MESHVERTEX (D3DFVF_XYZ| D3DFVF_NORMAL| D3DFVF_DIFFUSE)
struct MESHVERTEX
{
D3DXVECTOR3 Pos;
D3DXVECTOR3 Normal;
DWORD rgba;
};
MESHVERTEX* SphereVerts = new MESHVERTEX[iVQuantity];
/*Doing something here*/
BYTE* lpVertices;
m_pDevice->CreateVertexBuffer(iVQuantity * sizeof(MESHVERTEX), D3DUSAGE_WRITEONLY,D3DFVF_MESHVERTEX,D3DPOOL_MANAGED,&m_pVB,0);
m_pVB->Lock( 0, iVQuantity*sizeof(MESHVERTEX), (void**)&lpVertices, 0 );
memcpy( lpVertices, SphereVerts, iVQuantity*sizeof(MESHVERTEX) );
m_pVB->Unlock();
Am I overwriting the buffer? I have an assertion says _BLOCK_TYPE_IS_VAlID(pHead->nBlockUse),when I try to delete m_pVB.