glIndexPointer - VBO - how?

Started by tb, June 02, 2005, 16:48:44

Previous topic - Next topic

tb

Where is the glIndexPointer? Is there any other way, to use VBO for indices?

Thomas

tomb

Read "2.8A.1 Vertex Arrays in Buffer Objects" in the vertex_buffer_object doc.

I think you use the BufferData function to upload the vertices. The you can use the glDrawElements function that takes a "int indices_buffer_offset" to specify the offset.

Krux

I demand a working glIndexPointer Function as well as a correct implementation of glVertexPointerPointer, glColorPointer and glNormalPointer, that hal all parameters of the C function and accepting a ByteBuffer as last parameter. With the current implementation it is impossible to make working interleaved arrays Bytes Floats and Doubles mixed

Fool Running

Programmers will, one day, rule the world... and the world won't notice until its too late.Just testing the marquee option ;D

CodeBunny

Quote from: Krux on February 18, 2012, 16:51:51
...With the current implementation it is impossible to make working interleaved arrays Bytes Floats and Doubles mixed
I think you're ignoring the fact that people are able to make working VBOs in LWJGL.

Krux

don't take that demand too serious, but i would still be happe to easily port something like that

struct Vertex{
  float x,y,z;         //coord
  char nx,ny,nz;    //normal
  float tx, ty;        //texture coord
};

Vertex[] vertices = [...];

glVertexPointer(3,GL_FLOAT,sizeof(Vertex),&vertices[0].x);
glNormalPointer(GL_BYTE,sizeof(Vertex),&vertices[0].nx);
glTexCoordPointer(2,GL_FLOAT,sizeof(Vertex),&vertices[0].tx);