The reason why gl_Vertex
no longer available is because pre-defined attributes were removed. What was glVertexPointer
- now have to be manually set to user-defined named attribute with glVertexAttribPointer
. There is no way for shader to know what data comes to what attribute - because it is just numbers; however, how this numbers are handled is up to programmer.
So, you have to define at least one attribute (say vertexpos
, as in your example - but name could be almost anything), get attribute location (glGetAttribLocation
, or use location
specifier to assign default location) to convert symbolic name to attribute slot number, then assign attribute array with glVertexAttribPointer
.