I have a drawing function that draws to an offscreen graphics buffer, but would also like for the function to be able to draw to the PApplet as well. Is this possible?
I tried searching the forums but didn't really find anything... So apologies if this topic already exists!
I have a visualization program that seems to be quite CPU intensive, so I currently have it cycling between loop() when the mouse is pressed/dragged and noLoop() when the mouse is released so that it only gets redrawn when it needs to. This seems to work great at keeping the average CPU usage down.
However, I am attempting to add a ControlP5 gui 'control panel' in the same window and it is plagued by not properly registering mouse events when the program is in noLoop(). I almost have to click and
slightly drag (a pixel or two) for it to register that I've pressed a button. Then sometimes it doesn't finish drawing the button as 'on' (with new color) even though the button is in the new state before noLoop() gets called when the mouse is released.
Does anyone have any ideas on how I could tackle this issue? If there's a way to possibly listen for mouse events while the program is in a noLoop() state?