Processing

Processing is an open-source programming language and development environment for interactive animation, data visualization and more. Processing is used by many artists and programmers. Processing is created by Casey Reas and Ben Fry, of the Aesthetics and Computation Group at the MIT Media Lab in 2001.

Processing is built over the Java programming language, which offers you high performance and familiar object-orientation and syntax.

Processing is the easiest graphic programming language I've found so far. Here is a simple program that draws a line from top-left corner of the window to the position of your mouse.

A Simple Example

Processing offers a simple syntax that lets you to get things done quickly. Let's look at an example first.

// void setup() declares what will do after the program started
void setup() {
  size(400, 400); // set the window size to 400 x 400
  stroke(255); // set the stroke (line) color to white
}

// void draw() declares the draw cycle of the program
void draw() {
  background(0); // draw a black background to cover the previous line
  line(0, 0, mouseX, mouseY); // draw a line, mouseX and mouseY are the coordinates of the mouse.
}

Every programs have an entry point. In Processing, the entry point is the setup(). In the setup() method, the program preform initialization tasks such as setting screen size and global variables.

If you are into 3D game development, you know that a typical game has a draw cycle to repeatly update its graphics. In Processing, the draw() method does its job.

Instead of adding event handlers, Processing use global variables such as mouseX and mouseY to track the locations of the mouse.