byref_at for returning references to array elements
Brought to you by:
theller
Implements a simple way to return references to array elements. Allows
the following C code::
// from the OpenGL Programming Guide (Red Book), Fifth Edition, pp
455
glTexGenfv(GL_T, GL_OBJECT_PLANE, &tmpMatrix[4]);
To be written in ctypes like::
glTexGenfv(GL_T, GL_OBJECT_PLANE, byref_at(tmpMatrix, 4))
Instead of::
p = cast(tmpMatrix, c_void_p)
p.value += sizeof(tmpMatrix._type_) * 4
glTexGenfv(GL_T, GL_OBJECT_PLANE, cast(p, c_float_p))
Strawman byref_at implementation