Adding a function to the "Processing Animation Thread"

  • For most simple cases, a humble global boolean variable should be just enough.
  • Set it to true inside the threaded callback.
  • Then inside draw() keep checking whether it had become true.
  • If yes, set it back to false, and do the tasked drawing action there.
1 Like