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
Mapping DirectX to OpenGL
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?
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?
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
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
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement