agraef / pd-lua

Lua bindings for Pd, updated for Lua 5.3+
https://agraef.github.io/pd-lua/
GNU General Public License v2.0
51 stars 11 forks source link

Better way to manage currently active object, small API change, updated documentation, more... #42

Closed timothyschoen closed 8 months ago

timothyschoen commented 8 months ago

I guess I still wasn't completely done:

I made this draft just as a heads up that this is coming. I'll test this some more, then it should be ready to merge later today.

agraef commented 8 months ago

Ok, I'm waiting. :)

timothyschoen commented 8 months ago

Fixed some memory leaks, ran all the examples with Address Sanitizer and tested to work on Windows and macOS.

Now working on a final API change, which is how paths are constructed. I find the current API of calling path.start(x, y) to be kind of random, and we also don't want to pollute the namespace with lowercase names like that. A better replacement would be:

local p = Path(x, y)

or

local p = Path.start(x, y)

Any preference between these two?

timothyschoen commented 8 months ago

I've chosen the first option, because I think it more clearly communicates that this constructs and returns an object that you need to use.

timothyschoen commented 8 months ago

Alright this is ready! I also tested on Linux, also with valgrind, it doesn't find any problems :)

agraef commented 8 months ago

Looking good. This requires another Purr Data compatibility fix due to sys_hostfontsize(), but I can commit that in post. Merged, thanks!

agraef commented 8 months ago

@timothyschoen Just FYI, I just committed another minor fix for better Purr Data compatibility (rev. 77b2a76e3bf966b295509725aba661f6a813caf4) so that the gfx custom widget behavior doesn't interfere with Purr Data's own event handling. This only affects Purr Data.