C++ Mode for Processing. Write sketches with setup() and draw() inside the Processing IDE, or drop the engine into your own C++ project and use the same API from your own editor and build system.
If you know Processing, this is the fastest way in. Install C++ Mode through the Contribution Manager, select it from the mode dropdown, and write sketches exactly like you normally would. They compile to native C++ instead of Java, but the workflow is identical.
Install:
- Open Processing
- Click the mode dropdown (top right, says Java by default) → Add Mode...
- Search for C++ Mode and click Install
- Restart Processing, select C++ from the mode dropdown
void setup() {
size(640, 360);
}
void draw() {
background(20);
fill(255, 140, 0);
circle(mouseX, mouseY, 40);
}Use the Processing-style API in any C++ project without opening the Processing IDE. Two packaging options:
Drag-and-drop — unzip, drop two files next to your source, compile:
#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();
}g++ -std=c++17 main.cpp Processing.cpp -o sketch && ./sketchCMake — add as a subdirectory and link:
add_subdirectory(processing-cpp)
target_link_libraries(your_target PRIVATE processing_cpp)Get the latest release from the releases page:
processing-cpp-dragdrop.zip— drag-and-drop versionprocessing-cpp-cmake.zip— CMake version
MSYS2 with MinGW 64-bit. Install once:
pacman -S --needed mingw-w64-x86_64-gcc mingw-w64-x86_64-glfw mingw-w64-x86_64-glewAlways build from the MSYS2 MinGW 64-bit terminal, not PowerShell or Command Prompt.
Xcode command line tools and Homebrew:
xcode-select --install
brew install glfw glew# Ubuntu / Debian
sudo apt install g++ libglfw3-dev libglew-dev
# Arch
sudo pacman -S gcc glfw glewFull reference and tutorials at processing-cpp.github.io
- Getting Started — first sketch in the IDE
- Drag-and-Drop Setup — full Windows/macOS/Linux walkthrough
- CMake Setup — full Windows/macOS/Linux walkthrough
- Reference — full API reference
- Examples — 100+ example sketches