bastienleonard/pysfml2-cython — pull request #12 by Sonkun (2011-11-21 14:28:26+00:00)
Title: DerivableDrawable; a new class to make our own drawable possible.

Cython doesn't allow overriding virtual cpp method with a python method therefore we can't make our own drawable (overriding the virtual Drawable::Render method is required).

That's why appear a new cpp class (named PyDrawable) which overrides Drawable::Render and calls the python render method.

It's now possible but it sill has a problem about the arguments we have to pass to the python render method. To design our drawable we need the target (and then write stuff like that: target.draw(sprite)) but we can't provide it directly from the cpp class. That's why it stores these arguments in the Drawable class itself when a target.draw(drawable) is called. Then, _callrender does this work; it retrieve the target and pass to the final render method.

Performing low-level rendering is not implemented yet but I'm working on.