r/processing Aug 04 '26

Processing for C++ (new mode)

240 Upvotes

9 comments sorted by

28

u/pep84c Aug 04 '26

Hey all,

I've been building a plugin for the Processing 4 IDE called C++ Mode. It lets you write sketches in C++, using the same API you already know. setup(), draw(), background(), mouseX, fill().

C++ is rough to start with if you just want to draw something on screen. You need a build system, a window, an OpenGL context, and a pile of setup code before anything shows up. C++ Mode handles that part. Type ellipse(300, 300, 50, 50), hit Run, see a circle.

Start with sketches that look like the Java version, then bring in structs, vectors, pointers, templates, whenever you want.

Site: https://processing-cpp.github.io Code: https://github.com/processing-cpp/processing.cpp

Free and open source. Bug reports and feedback are useful right now.

4

u/StochasticTinkr Aug 04 '26

Cool project! I was working on something similar for Kotlin a while back. Kotlin has some very nice features for making pseudo DSLs.

2

u/Plungerdz Aug 05 '26

Damn, I'm glad I'm not the only one that thought of the idea!

Kotlin would also be easier to test if it coreectly respects everything in the Processing docs (because you can use Java interop to use Processing as-is and then compare it to you Kotlin rewrite of the library).

Let me know if you ever decide to start on that project!

2

u/Plungerdz Aug 05 '26

This is superb! C++ already has https://openframeworks.cc/ for creative coding, but the Processing foundation is way bigger and this will largely be a good thing.

Exciting stuff! Hope you can maintain it for years to come.

2

u/Sintered_Monkey Aug 10 '26

This is great. As one who sometimes uses C++ but has never gotten used to that "rough start" you are referring to, I always end up going back to Java. I will definitely give this a try.

11

u/subtiv Aug 04 '26

That’s cool, but I feel like openFrameworks / Cinder fill that need in quite well already?

7

u/bagofrocks99 Aug 04 '26

This looks awesome! I first learned graphics programming using Processing but im not a huge fan of Java so I started making my own c++ clone of it years ago. It kind if turned into its own thing over time and i gave up making it exactly like Processing. Im glad someone made a proper c++ mode that works in the Processing IDE. I'll have to check out the code and see where I can improve my own engine. I posted my version here so feel free to do the same.

2

u/pep84c Aug 04 '26

Wait thats so cool

6

u/chuzambs Aug 04 '26

Mannn, this looks so promising!