c++ - Curious "void*" parameter on some GL functions -


For some functions in OpenGL, someone has to specify a byte offset, such as glVertexAttribPointer ()

For the first time, I would have guessed that it would be a normal number value like integer. But upon inspection, I realized that it needs to be inserted in zero * (more specifically GLvoid * ). My question is, what is the intention of zero * and why it should be used for offset bytes? GlvetexAttribPointer () is an old function before the Vertex buffer object.

Before VBO your top data will be stored in the client side array and before you draw, OpenGL will have to pass a pointer in the data.

When VBO came along, they repurposed this function by allowing the function to be used to pass the integer offset.

For example zero * offset = (zero *) offscot (vertextstructname, vertexembar_name);


Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -