How to draw the array which I’m drawing that:
glBegin(GL_TRIANGLES);
for (UINT i = 0; i < VertexArraySize[id]; i+=3)
{
glVertex3f(VertexArray[id][i], VertexArray[id][i+1], VertexArray[id][i+2]);
}
glEnd();
using glVertexArray?
I want to draw whole array without using glDrawElements. I’ve tried glDrawArrays but it doesn’t work and I don’t know where is the mistake.
But just from the first look at your code, it looks ok.
Originally posted by glYaro:
[b]Hi,
How to draw the array which I’m drawing that:
glBegin(GL_TRIANGLES);
for (UINT i = 0; i < VertexArraySize[id]; i+=3)
{
glVertex3f(VertexArray[id][i], VertexArray[id][i+1], VertexArray[id][i+2]);
}
glEnd();
using glVertexArray?
I want to draw whole array without using glDrawElements. I’ve tried glDrawArrays but it doesn’t work and I don’t know where is the mistake.
Originally posted by Punchey: Why don’t you want to use glDrawElements?
Because to use glDrawElements I have to make create an array with indices of my VertexArray elements and pass a pointer to this array as an argument in
glDrawElements(enum mode, sizei count, enum type, void *indices),
don’t I?
Looking above I have to create array with indices for every VertexArray I use.
I’m searching for way to draw VertexArray
using one function, not creating else arrays.
Originally posted by darkbyte:
[b]Why don’t you post your glDrawArrays code so maybe we can see why it’s not working?
J.[/b]
I’ve got better idea. Maybe You can post the code for rendering array called
GLfloat VertexArray[n];
with for example GL_TRIANGLES?
I’m searching for the fastest way to draw this array (by one function). I saw the extensions for vertex arrays, are those better then simple glVertexPointer and glDrawArrays?