DX/OGL vertex buffer compatability
I'm working with some other people and I'm setting up a vertex buffer class, and I need to know if there is a way to store the vertex buffers in a way the both directx and OGL can use.
dx stores all the vertecies in an array, OGL seems to use a bunch of paralel arrays of diferent data (one for position another for UV coords) I know nothing of OGL but I need to know of a way to get either to use a vertex buffer format that can be used by the other. (ie I can do a simple memcpy of the same data)
You can use vertex streams to sort the buffers on type.
Device->SetStreamSource( 0, &VB1 ); //Position
Device->SetStreamSource( 1, &VB2 ); //UV
Device->SetStreamSource( 0, &VB1 ); //Position
Device->SetStreamSource( 1, &VB2 ); //UV
Quote:
OGL seems to use a bunch of paralel arrays of diferent
not mendatory you can also use your std DX vertex struct
with OpenGL look at the offset parameter.
by
einKI
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement