← Back to Downloads

Drag-and-Drop Setup

The easiest way to get started. Unzip one folder, write a .cpp file next to it, and run one script. No build system, no configuration.

Pick your operating system:

Windows
macOS
Linux

Step 1 Install MSYS2 (once only)

Go to msys2.org and download the installer. Run it, click Next until done. After it installs a black window opens automatically. Paste this in and press Enter:

pacman -S --needed mingw-w64-x86_64-gcc mingw-w64-x86_64-glfw mingw-w64-x86_64-glew

Press Enter again when it asks to confirm. Wait for it to finish, then close that window.

Step 2 Get the package

Download processing-cpp-dragdrop.zip from the Downloads page. Right-click it and choose Extract All. You'll get a folder called processing-cpp-dragdrop. rename it to processing-cpp.

Step 3 Set up your project folder

Create a new empty folder anywhere, call it MySketch. Move the processing-cpp folder into it:

MySketch/
└── processing-cpp/

Step 4 Write your sketch

Open Notepad. Paste the code below. Save it as main.cpp directly inside MySketch, next to the processing-cpp folder, not inside it.

#include "Processing.h"

struct Sketch : public Processing::PApplet {
    void settings() override { size(640, 360); }
    void setup()    override { background(0); }
    void draw()     override {
        background(0);
        fill(255, 140, 0);
        circle(mouseX, mouseY, 40);
    }
};

int main() {
    Sketch sketch;
    sketch.run();
}

Your folder should now look like this:

MySketch/
├── main.cpp          ← your file
└── processing-cpp/   ← the package

The sketch uses circle(), fill(), background(), and mouseX / mouseY. Everything in the reference works the same way.

Step 5 Open VS Code and the terminal

Open VS Code, go to File → Open Folder and select your MySketch folder. Then open the integrated terminal with Ctrl+`.

Important: The default terminal in VS Code on Windows is PowerShell, which doesn't have g++. Click the dropdown arrow next to the + in the terminal panel and select MSYS2 / MinGW64 instead. The prompt should say MINGW64.

Step 6 Run it

./processing-cpp/run.bat

The first run takes about 15 seconds because it's compiling the engine. After that a window opens with an orange circle that follows your mouse. Every run after the first is much faster since the engine is already built.

MSYS2 MinGW terminal running run.bat, sketch window open with orange circle
assets/screenshot11.png MSYS2 MinGW terminal running run.bat, sketch window open with orange circle
If you get "command not found": you're in the wrong terminal. Close it, open MSYS2 MinGW 64-bit (look for MINGW64 in the title bar), and try again. This is the cause almost every time on Windows.

Step 1 Install the tools (once only)

Open Terminal (Applications → Utilities). Run these one at a time:

xcode-select --install

A popup appears. click Install and wait for it to finish. Then install Homebrew:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Then the graphics libraries:

brew install glfw glew

Steps 2-4 Get the package and write your sketch

Same as Windows: download processing-cpp-dragdrop.zip, rename the extracted folder to processing-cpp, create a MySketch folder, and write main.cpp with the same code as above inside it.

Step 5 Open VS Code and the terminal

Open VS Code, go to File → Open Folder and select your MySketch folder. Open the integrated terminal with Ctrl+` (or Cmd+` on macOS).

Step 6 Run it

./processing-cpp/run.sh

First run compiles the engine (~15 seconds). Then a window opens. Every run after that is fast.

macOS Terminal running run.sh, sketch window open
assets/screenshot12.png macOS Terminal running run.sh, sketch window open

Step 1 Install the tools (once only)

Open a terminal and run the command for your distro:

# Ubuntu / Debian
sudo apt install g++ libglfw3-dev libglew-dev

# Arch
sudo pacman -S gcc glfw glew

Steps 2 onwards same as macOS

Download processing-cpp-dragdrop.zip, rename the extracted folder to processing-cpp, create a MySketch folder, write main.cpp with the same code, navigate to the folder, then run:

./processing-cpp/run.sh