Skip to main content
GameDev.net gamedev.net
๐Ÿ”’ Locked

Dynamic array in a vertex buffer

Started by NeKe Jan 8, 2003 at 11:22 AM 0 replies 450+ views
Original Post
NeKe
NeKe
When I declare my array with a constant: sVertex Verts[36]; then this code runs smooth: // Create the vertex buffer and set data g_pD3DDevice->CreateVertexBuffer(sizeof(sVertex)*36, 0, \ VERTEXFVF, D3DPOOL_DEFAULT, &g_pVB); g_pVB->Lock(0,0, (BYTE**)&Ptr, 0); memcpy(Ptr, Verts, (sizeof(Verts))); g_pVB->Unlock(); When I declare my array dynamically, however: sVertex* Verts = new sVertex[(m_Elf.FaceCount*3)]; It doesn''t fly even though I use the exact same size of array - > 36: Why?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.