VBO Tutorial ready for review!

Here’s what I think they’re getting at. If you use the legacy vertex attribs, you do glEnable/DisableClientState and gl*Pointer, where * is Vertex, Color, Normal, etc., to set up the vertex attribute array. With these you specify the vertex attrib by legacy “name”.

If you instead use the new-style generic vertex attribs, you instead do glEnable/DisableVertexAttribArray and glVertexAttribPointer to set up the vertex attribute. Same thing, just different APIs, and you specify the attribute by integer “index” rather than by legacy name.

Note that despite an incorrect assertion above (Simon misspoke), this has nothing to do with client arrays vs. VBOs (i.e. server arrays). You can use generic vertex attribs with either, and you can use legacy vertex attribs with either.

The glEnable/DisableClientState deprecation is merely meant to encourage you to use the new generic vertex attribs rather than the legacy vertex attribs.

So yeah, use the generic vertex attributes.

Whew! Thanks DP, will look into this, try it out, and modify the whole thing accordingly, which will probably take me into next week.

So the tutorial may have some relevance once again – there are for sure ZERO examples on-line using the new non-legacy style.

http://dl.dropbox.com/u/1969613/openglForum/OpenIL.h
http://dl.dropbox.com/u/1969613/openglForum/OpenIL.cpp
http://dl.dropbox.com/u/1969613/openglForum/gl_extensions.h

Pure 3.2 . Has 2-3 problematic things around textures, but still can be of use for studying.
A snippet to show how the funcs above are used:
http://dl.dropbox.com/u/1969613/openglForum/ILXSnippetDraw.cpp

Sorry, I should’ve said “in C”

[some extraneous comments deleted ;)]

But since there is nothing else, I’ll take a look. Thanks.

Accepting glEnable/glDisableVertexAttribArray means skipping to OpenGL Shading Language! :wink:

I’ll wish you luck on this voyage to a totally new world!

The openGL core is a C API and I don’t see any need to demonstrate it using C++ anyway, this just excludes some of the user base.

Did you actually read the code, or did you just look at the .cpp extension and think, “well, that’s C++, so I can’t possibly understand it.”

The only thing C++ in those code files is the fact that it defines variables at arbitrary locations within a function (and even that’s standard C99). There are no classes, operator overloading, function overloading, templates, template metaprogramming, RAII, or anything that is even remotely C++. It even uses the braindead “typedef struct” syntax for its structs.

I know it’s a shock to realize this, but C++ is also C.

BTW, the OpenGL API is not a C API. It is usually exposed through C, but the OpenGL specification is language-neutral.

Whoops, deleted most of the post before I noticed these responses, since it seemed slightly obnoxious.

Anyway, no, I haven’t had a look yet. I do think it is just bad form to strap a bunch of extraneous detail into a demo HOWEVER, I still don’t know what those demos are for, so I can’t really call any of the details “extraneous”. Extraneous to my purposes, anyway. It’s not so much a matter of being “unable”, it’s more a matter of convenience – eg, I like having shortcuts to common directories, tho I am generally able to find them one node at a time if not.

All apologies.

Yep, that’s where I’m headed. I suspect there are/will be enough other people in the same boat to justify the tutorial as a “transitional” step.

Anyway, no, I haven’t had a look yet. I do think it is just bad form to strap a bunch of extraneous detail into a demo HOWEVER, I still don’t know what those demos are for, so I can’t really call any of the details “extraneous”. Extraneous to my purposes, anyway.

How can you say that? You are judging a demo you admit to not having seen, saying that it has “extraneous detail”. How could you possibly know that anything in that code is “extraneous to my purposes.”

You’re literally judging code based solely on the presence of the “pp” at the end of the filename extension. Even a cursory inspection of the code would show it to be C+±in-name-only.

:eek: Okay, you got me on some semantics there AR. I did take a glance.

To be fair, pretty sure those are actually files left by Illian Dinev at dropbox because of this (much thanks!) so were NOT written for the purpose of educating me. Guess I got a little defence and thought it was someone again trying to prove this is adequately documented on line.

And yeah, I should be able to figure it out now, or later today.

So, sorry again. I promise: from now on I count to 10 before posting.

Don’t sweat it. In any group, there are always those that are just begging to be offended. You’re doing great. Thanks for the tutorial!

I tryed to compile the example programs on the VBO tutorial and I got these linker errors:

[Linker error] undefined reference to glWindowPos2i@8' [Linker error] undefined reference toglGenBuffers@8’
[Linker error] undefined reference to glBindBuffer@8' [Linker error] undefined reference toglBufferData@16’
[Linker error] undefined reference to glBindBuffer@8' [Linker error] undefined reference toglBindBuffer@8’

which libary has these?

EDIT:
Oh I figguered it out, I used GLee and that seemed to do the trick