LWJGL Forum

Programming => OpenGL => Topic started by: tb on June 02, 2005, 16:48:44

Title: glIndexPointer - VBO - how?
Post by: tb on June 02, 2005, 16:48:44
Where is the glIndexPointer? Is there any other way, to use VBO for indices?

Thomas
Title: glIndexPointer - VBO - how?
Post by: tomb on June 02, 2005, 17:19:54
Read "2.8A.1 Vertex Arrays in Buffer Objects" in the vertex_buffer_object doc (http://oss.sgi.com/projects/ogl-sample/registry/ARB/vertex_buffer_object.txt).

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.
Title: Re: glIndexPointer - VBO - how?
Post by: Krux on February 18, 2012, 16:51:51
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
Title: Re: glIndexPointer - VBO - how?
Post by: Fool Running on February 20, 2012, 14:14:00
Quote from: Krux on February 18, 2012, 16:51:51I demand...
lol! ;D
Title: Re: glIndexPointer - VBO - how?
Post by: CodeBunny on February 20, 2012, 20:05:48
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.
Title: Re: glIndexPointer - VBO - how?
Post by: Krux on May 09, 2012, 21:28:29
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);