Indexed Vertex Buffers?

Hi,

I am just starting to look at OpenGL to make my DirectX engine cross-platform, and I was wondering if OpenGL has the ability to do indexed vertex buffers like DirectX? The beginners book I have does not mention it, but then I think it is geared towards v1.1.

Thanks!

Yes it does. Look at the VBO spec in the extension registry and the spec.

http://www.opengl.org/documentation/spec.html
http://oss.sgi.com/projects/ogl-sample/registry/

Hlz

… buffer objects start on page 33 of the 2.0 spec.

Hlz

Originally posted by <Hlz>:
[b]… buffer objects start on page 33 of the 2.0 spec.

Hlz[/b]
Thanks for your reply. Is 2.0 supported for windows? My book says the ‘wiggle’ stuff is only v1.1.

Is 2.0 supported for windows?
This really depends on the card you have. Some things like FBOs and GLSL are still fairly new and a bit shakey in some areas, but work for the most part.

But all you need to do is check the extension string for support of the things you are interested in for a particular card. The extension registry link above has some details on this, like the glext.h and wglext.h headers you’ll need.

Vertex buffer objects have been in the core since 1.5 I think.

Hlz

Originally posted by <Hlz>:
[b] [quote]Is 2.0 supported for windows?
This really depends on the card you have. Some things like FBOs and GLSL are still fairly new and a bit shakey in some areas, but work for the most part.

But all you need to do is check the extension string for support of the things you are interested in for a particular card. The extension registry link above has some details on this, like the glext.h and wglext.h headers you’ll need.

Vertex buffer objects have been in the core since 1.5 I think.

Hlz[/b][/QUOTE]Thank you. Looks like it’s time to get my hands dirty :stuck_out_tongue:

you can use stuff like this:

glInterleavedArrays(GL_T2F_V3F, 0, @pointer to vertices, tex coords, normal and color data);
glDrawElements(GL_quads, 4, GL_UNSIGNED_INT (data format of indexes), @pointer to vertex indexes);

the function is part of opengl 1.1 so it works on practically all implementations.

whole documentation is like this:
from http://pyopengl.sourceforge.net/documentation/manual/glDrawElements.3G.html

glDrawElements specifies multiple geometric primitives with very few subroutine calls. Instead of
calling a GL function to pass each individual vertex, normal, texture coordinate, edge flag, or color, you can
prespecify separate arrays of vertexes, normals, and so on and use them to construct a sequence of primitives with a
single call to glDrawElements.

		When glDrawElements is called, it uses count sequential elements from an
		enabled array, starting at indices to construct a sequence of geometric primitives.
		mode specifies what kind of primitives are constructed, and how the array elements construct
		these primitives. If more than one array is enabled, each is used. If GL_VERTEX_ARRAY is not
		enabled, no geometric primitives are constructed.
	

		Vertex attributes that are modified by glDrawElements have an unspecified value after
		glDrawElements returns. For example, if GL_COLOR_ARRAY is enabled, the value
		of the current color is undefined after glDrawElements executes. Attributes that aren't modified
		maintain their previous values.