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

CreateVertexBuffer question

This topic is 5598 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

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]

Share this post

Link to post
Share on other sites