plugdata-team / plugdata

Pure Data as a plugin, with a new GUI
https://plugdata.org
GNU General Public License v3.0
1.57k stars 66 forks source link

pd_lua paint(g) function is called every frame, even if there is nothing new to draw #1868

Closed jyg closed 1 month ago

jyg commented 1 month ago

I have a pdlua gui script that does nothing, but has a paint(g) function that increments a counter each time it is called. In pd, its refreshed only when resizing the window or calling repaint() function. In plugdata it is refreshed every frame, leading to a giant overload if I use many of those scripts.

windows 11, plugdata Nightly build: eb4d28f03

https://github.com/user-attachments/assets/f36c8042-29fb-4769-b4f8-c837dc0b7546

testMyGui.zip

timothyschoen commented 1 month ago

Thanks for reporting! I just made some changes on nightly, I think this is fixed now