0

I've been using some self made wrappers for OpenGL. I wanted to switch fully to OpenGL 3.3+ and get rid of deprecated function. I used this code for setting data offsets sent to shaders:

glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(Vertex), (GLvoid*)offsetof(Vertex,color) );
glTexCoordPointer(2, GL_FLOAT, sizeof(Vertex), (GLvoid*)offsetof(Vertex,textCoord) );
glNormalPointer(GL_FLOAT, sizeof(Vertex), (GLvoid*)offsetof(Vertex,normal) );
glVertexPointer(3, GL_FLOAT, sizeof(Vertex), (GLvoid*)offsetof(Vertex,position) );

What's the alternative for it now? Gl3w (which I use) does not support it. I can't see any good tutorial for the new approach of sending data to shaders without deprecated functions.

Krzycho
  • 99
  • 1
  • 11
  • 3
    All this functions are replaced by `glVertexAttribPointer` and custom attributes in the shader – BDL Aug 26 '15 at 15:57
  • look here [GL+VAO/VBO+GLSL full example in C++](http://stackoverflow.com/a/31913542/2521214) find `gl_simple.h` and inside look at `vao_init()` – Spektre Aug 26 '15 at 16:37

1 Answers1

0

So as BDL wrote in the comment:

All this functions are replaced by glVertexAttribPointer and custom attributes in the shader

It's well discribed on open.gl in Making the link between vertex data and attributes section.

Krzycho
  • 99
  • 1
  • 11
  • also if you got `nVidia` it is sometimes a good idea to start with [default attribute locations](http://stackoverflow.com/a/20574219/2521214) it will render also with fixed function (no or not compiled shaders) so you have a feedback if your geometry passing is working or not ... – Spektre Aug 27 '15 at 06:47