Hello Guest

glIndexPointer - VBO - how?

  • 5 Replies
  • 10009 Views
*

Offline tb

  • *
  • 7
glIndexPointer - VBO - how?
« on: June 02, 2005, 16:48:44 »
Where is the glIndexPointer? Is there any other way, to use VBO for indices?

Thomas

*

Offline tomb

  • ***
  • 148
glIndexPointer - VBO - how?
« Reply #1 on: June 02, 2005, 17:19:54 »
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.

*

Offline Krux

  • *
  • 24
Re: glIndexPointer - VBO - how?
« Reply #2 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

Re: glIndexPointer - VBO - how?
« Reply #3 on: February 20, 2012, 14:14:00 »
Programmers will, one day, rule the world... and the world won't notice until its too late.Just testing the marquee option ;D

Re: glIndexPointer - VBO - how?
« Reply #4 on: February 20, 2012, 20:05:48 »
...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.

*

Offline Krux

  • *
  • 24
Re: glIndexPointer - VBO - how?
« Reply #5 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

Code: [Select]
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);