Re: [PyOpenGL-Users] mixing C++ and python w/ opengl
Brought to you by:
mcfletch
From: Alejandro S. <as...@gm...> - 2011-01-26 14:40:38
|
On Tue, Jan 25, 2011 at 9:48 PM, Philip Winston <pwi...@gm...> wrote: > You may want to try using Cython, rather than raw C. > > > We've been meaning to investigate Cython. We use C/C++ libraries and > ctypes today. One advantage of C is that other C/C++ programs can use the > libraries. But I'm interested in trying Cython just to learn about it. > I definitely recommend it. I used Cython to expose the core classes of an in-house render engine I was developing in C++ to Python code and I can say it was a breeze. All you have to do is write a simple wrapper around your C/C++ code and a pyx file that will compile your wrapper into a shared object. You can then import the compiled .so from Python. Wrapping C++ was a little more complicated than pure C, as objects had to be used as opaque types in version 0.12, but now that version 0.13 is out, C++ support has been vastly improved. Once you have your Cython module compiled, you can create an OpenGL window/panel from Python code and the draw calls in your C/C++ code will automagically work :) Good luck! Alejandro.- > > ------------------------------------------------------------------------------ > Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! > Finally, a world-class log management solution at an even better > price-free! > Download using promo code Free_Logger_4_Dev2Dev. Offer expires > February 28th, so secure your free ArcSight Logger TODAY! > http://p.sf.net/sfu/arcsight-sfd2d > _______________________________________________ > PyOpenGL Homepage > http://pyopengl.sourceforge.net > _______________________________________________ > PyOpenGL-Users mailing list > PyO...@li... > https://lists.sourceforge.net/lists/listinfo/pyopengl-users > > -- Alejandro Segovia Azapian Director, Algorithmia: Visualization & Acceleration http://web.algorithmia.net |