Mapping DirectX to OpenGL

Started by
13 comments, last by Mythomania 22 years, 5 months ago
i''m not sure of the syntax, but for having just one array, you''d be using glInterleavedArray or something like that. this means that the array contains data like vertex, normal, color, vertex, normal, color, vertex, normal, color.... etc. so, different types of data are thrown into one array, as opposed to several arrays of different data.

a2k
------------------General Equation, this is Private Function reporting for duty, sir!a2k
Advertisement
I think I understand now. When I want to specify one vertex array like in D3D with a vertex format that contains position, normal and color I would do the following:

struct Vertex
{
float x, y, z;
float normalx, normaly, normalz;
DWord color;
};

Vertex vertices[100];

//fill vertices

//and now the important bit:

VertexPointer(3, FLOAT, sizeof(Vertex), vertices);
NormalPointer(FLOAT, sizeof(Vertex), vertices+12);
ColorPointer(4, BYTE, sizeof(Vertex), vertices+24);

This would work, right?

Now the last question: How does OGL work together with video and agp mem now? When is the data put into this mem? And how does OGL decide where?


Indifference will be the downfall of mankind. But who cares?
The OpenGL Red Book has been placed online somewhere.
That would answer alot of your questions.
No, I don`t know where it is- does anybody else know ?
~V''lion

I came, I saw, I got programmers block.
~V''''lion
~V'lionBugle4d
think i found it
http://fly.cc.fer.hr/~unreal/theredbook/
Indifference will be the downfall of mankind. But who cares?
Try the opengl faq on www.opengl.org site.

This topic is closed to new replies.

Advertisement