Re: [AD] Building python wrapper + docs in MSVC

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On Thu, Jan 20, 2011 at 3:38 PM, John-Kim Murphy <leftium@xxxxxxxxxx> wrote:
>
> Thanks~ I noticed two possible bugs:
>
> "%(release)s-$(version)s" should be "%(release)s-%(version)s" [generate_python_cytpes.py]

Indeed, I'll fix it. Usually you'll have to hand-edit this anyway
though since DLL names can be different, e.g. myself I use only the
allegro-monolith.dll instead of the separate ones. I haven't found a
good way how to do this automatically. Probably the easiest way for
the user would be if they could specify a list of .dll/.so/.dylib
files in which to look for the Allegro symbols instead of trying to
guess the DLL names.

>
> why not just: al_draw_textf(font, x, y, flags, "%d, %d" % (x, y))? [python/readme.txt]

The problem is that in the C API the function looks like this:

void al_draw_textf(const ALLEGRO_FONT *font, ALLEGRO_COLOR color,
float x, float y, int flags, const char *format, ...)

But generate_python_ctypes.py makes this:

al_draw_textf = _dll("al_draw_textf", c_int, [c_void_p, ALLEGRO_COLOR,
c_float, c_float, c_int, c_void_p, c_void_p])

So right now it needs two pointer parameters. Problem is how the
wrapper generator just recognizes a "..." parameter as a c_void_p,
I'll eventually fix it :) In this specific case you can also use
al_draw_text (without the f at the end) though.




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/