[C++-sig] Wrapping types with boost.python

Robert Parcus betoparcus at hotmail.com
Tue Jul 5 15:01:00 CEST 2011


Hello all, I'm new here :)
I'm a CS student doing my internship and I'm working on wrapping the glm library (http://glm.g-truc.net/) to export it to python. (eg. I have a lot of time to do it, but I'm learning while I'm doing it)It's an open source library and the results (if any) of my work will go to the same field.
I've spent the last few weeks familiarising with boost.python and I've spent a large amount of time looking for and reading tutorials and examples but now I feel like I have to ask you for some help, if that's ok.
glm is a header only library and it has many types (mostly vectors(n), matrices(n,m)...) and many many functions to play with them. It also makes heavy use of templates. 
While exposing the functions has been pretty easy, I was not able yet to expose a single type. (I have been exposing the functions and specializing them only with int, double, etc types not the vectors and matrices, which are the most important types for me actually... I did it as a proof of concept, and because I'm stuck in this "exposing types" problem since a long time...)
As an example, on line 38 of this code http://glm.g-truc.net/api-0.9.1/a00127_source.html is the definition of vec2. All glm types are pretty similar to this and if I could have some insights on how to wrap something like this the rest would be almost "not very hard" for me to do.
Thanks in advance,
Robert
ps: I also checked py++ in the beginning of my researches. I couldn't make it work at the time, and I'm not even sure a library like glm could be easily wrapped using it. Any advices about that as well? 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20110705/4b498e6b/attachment.html>


More information about the Cplusplus-sig mailing list