DX/OGL vertex buffer compatability

Started by
2 comments, last by Bobboau 19 years, 8 months ago
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)
Bobboau, bringing you products that work... in theory
Advertisement
You can use vertex streams to sort the buffers on type.

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
so if I just SetStreamSource with the proper FVFs it will sort it's self out on it's own? or do I need to define were it looks for what data?

and is it better to do this the directx way or the OGL way (useing one or more than one stream)

[Edited by - Bobboau on August 4, 2004 8:26:05 AM]
Bobboau, bringing you products that work... in theory

This topic is closed to new replies.

Advertisement