c - OpenGL Vertex Arrays -


I have a straight line called dot (which is a python extension) Looks:

  struct point {PyObject_HEAD // macro which spreads to include some more members in Double X; Double wi; };  

And I have another strat that will keep one bunch of these two arrays:

  Structure polygon {int length; Point ** vertex_point; Point ** texcrd_points; }  

I want to use them to map both the vectors and texture direction of a polygon with the vertex array. The problem is that the Vertex array expects arrays in the format:

, <, What is a way I can call glVertexPointer and glTexCoordPointer with Polygon-> Vertex_points and Polygon-> Texcrd_points , or do I expect * indicator that matches new arrays?

After the

You can call Glitaxx Pointer With the basis of its top array with the basis of the texture cores array, and the number of things in those arrays increases to the correct (same) numbers, it should work fine as long as glTexCoordPointer .

OpenGL clearly can not reach the members of the structure Members will be kept in memory next to each other (see warning below) If multiple point structures are in a series of memory, then effectively You have a big flat list of doubles. Do not know about OpenGL structures, it just wants a big list (double in this case) values ​​but you can create a series of digits and openGL can make an indicator for the first time, and if the layout in the layout is not wrong Or is not cushionable, then it would be equivalent.

If you are very new to C this is under the concept of your belt (with memory layout cavities), then you must copy all pairs in a new array before calling GL.

I question some things: Maybe the code is missing here, but instead of point ** instead of point * , it looks messy, Because GlVertexPointer etc would expect the flat array of values ​​here. By the same token, although this is probably already linked, in theory, an array of those stranks can not be flush packed in memory. You can do it explicitly on the basis of your compiler, or you can play with the Stride Ultimate in GL calls to be clear about the distance between each wart.


Comments