I was looking at the Particles examples of CUDA and I couldn’t find where to they make the link between the array of vertices and the variables in the shader. From what I’ve read and actually the way I’ve been doing it is
glBufferData( … )
glVertexAttribPointer( … );
however what I found in Nvidia’s example looks like
glVertexPointer(4, GL_FLOAT, 0, 0);
glColorPointer(4, GL_FLOAT, 0, 0);
glDrawArrays(GL_POINTS, 0, m_numParticles);
which I believe is something similar to what I do. So my questions are
What’s the difference between those two ways of passing data to the shader?
Should I prefer one over the other?