Skip to content

Instantly share code, notes, and snippets.

@tingham
Created August 9, 2013 04:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tingham/6191156 to your computer and use it in GitHub Desktop.
Save tingham/6191156 to your computer and use it in GitHub Desktop.
Example of structuring your Processing sketch to avoid having to restart everything.
void setup ()
{
size(width, height, P3D);
thread("update");
}
void update ()
{
while (true) {
try {
// do my sketching into a separate context, like an int[]
Thread.sleep(30);
} catch (Exception e) {
}
}
}
void draw ()
{
// do my drawing
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment