Question

I'm currently learning the differences between OpenGL 2 and 3, and I noticed that many functions like glVertex, glVertexPointer, glColor, glColorPointer, etc. have disappeared.

I'm used to using Cg to handle shaders. For example I'd write this simple vertex shader:

void main(in inPos : POSITION, out outPos : POSITION) {
    outPos = inPos;
}

And then I'd use either glVertex or glVertexPointer to set the values of inPos.

But since these functions are no longer available in OpenGL 3, how are you supposed to do the bindings?

Was it helpful?

Solution

First I'll recommend you to take a look at the answer to this question: What's so different about OpenGL 3.x?

Secondly, Norbert Nopper has lots of examples on using OpenGL 3 and GLSL here

Finally here's a simple GLSL example which shows you how to bind both a vertex and a fragment shader program.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top