• Popular Now

• 13
• 18
• 19
• 27
• 10

Archived

This topic is now archived and is closed to further replies.

CreateVertexBuffer question

This topic is 5692 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

Let's say I have something like this:

struct MyVertex
{
float x, y, z;
D3DXCOLOR diffuse;
float u, v;
}

// Init D3D and all that jazz

nVerts       = 1000;
MyVertex*  pMyModel;
pMyModel   = new MyVertex[ nVerts ];

// Assign something to pMyModel


Can I then create my vertex buffer by saying something like this: pD3DDevice->CreateVertexBuffer( sizeof(pMyModel), ... ); All of the books, tutorials, etc seem to define the size of the buffer more like this: pD3DDevice->CreateVertexBuffer( sizeof(MyVertex) * nVerts, ... ); Is that just to spell out what you need to give it, or is there some potential difference in the two? -John [edited by - Teknofreek on August 18, 2002 4:16:18 PM]