NEWBIE: What lines of code do I need for setting up ARB_vertex_program?

This is my first post on the board.

Anyways, I have the Det 40’s installed and all that good stuff, but let’s say I’m using NeHe’s lesson2 code and I want to make my own ARB_vertex_program. What code would I need to add? I searched the board and couldn’t find what I was looking for, and I also can’t seem to find any examples anywhere on the 'net.

You need to use glGetString() to get the extensions string to test that the extension is supported.

Then you need to use wglGetProcAddress() (or glx, or whatever your platform is) to get the extension functions as defined in the extension registry.

You need to Enable() on VERTEX_PROGRAM_ARB.

You need to use GenProgramsARB() to generate program Ids (much like texture Ids), BindProgramARB() to bind a program, ProgramStringARB() to actually send your program to the system (much like TexImage). You do this on the VERTEX_PROGRAM_ARB target.

Use GetString() on PROGRAM_ERROR_STRING_ARB to get the error message if ProgramStringARB() failed.

You need to set up any parameters your program may need with ProgramEnvParameterARB() and ProgramLocalParameterARB().

You need to feed vertex data to the program with VertexAttrib*ARB() (or the array version).

For more details, see the document at http://www.nvidia.com/dev_content/nvopenglspecs/GL_ARB_vertex_program.txt (or in the extension registry, or on ATIs web site; same thing)

Is there any difference between GL_NV_vertex_program and GL_ARB_vertex_program or they have only different names?

And what about GL_EXT_vertex_program (or sth like that)?

There are quite a lot of differences and they are definitly not compatible. Check out the specs in the extension registry: http://oss.sgi.com/projects/ogl-sample/registry/

Originally posted by jwatte:
[b]You need to use glGetString() to get the extensions string to test that the extension is supported.

Then you need to use wglGetProcAddress() (or glx, or whatever your platform is) to get the extension functions as defined in the extension registry.

You need to Enable() on VERTEX_PROGRAM_ARB.

You need to use GenProgramsARB() to generate program Ids (much like texture Ids), BindProgramARB() to bind a program, ProgramStringARB() to actually send your program to the system (much like TexImage). You do this on the VERTEX_PROGRAM_ARB target.

Use GetString() on PROGRAM_ERROR_STRING_ARB to get the error message if ProgramStringARB() failed.

You need to set up any parameters your program may need with ProgramEnvParameterARB() and ProgramLocalParameterARB().

You need to feed vertex data to the program with VertexAttrib*ARB() (or the array version).

For more details, see the document at http://www.nvidia.com/dev_content/nvopenglspecs/GL_ARB_vertex_program.txt (or in the extension registry, or on ATIs web site; same thing)[/b]
Cool, thanks. That link is some pretty heavy reading, but I should get through it soon.

Originally posted by MichaelK:
[b]Is there any difference between GL_NV_vertex_program and GL_ARB_vertex_program or they have only different names?

And what about GL_EXT_vertex_program (or sth like that)?[/b]

You can see the differences in detail with those two extensions in the ARB_vertex_program spec.

[This message has been edited by Cab (edited 10-22-2002).]