Hi,
I wish to register my math classes with Angelscript and use reference counting to manage the memory. However, the problem I have with this is the need to add an integer to the class to keep track of the number of references to the object used (addref/release methods). The reason for this is that my math classes work with OpenGL, so when I pass an array (pointer) of matrices or vectors, they will work directly with opengl shader programs. Adding an integer would break this and was wondering if there's a way to solve this problem without using external reference counters which would need a lookup and slow the whole thing down. I'm hoping somebody can help me overcome this problem.
Thanks.
C++