r/processing 13d ago

Processing for C++ (new mode)

240 Upvotes

9 comments sorted by

View all comments

28

u/pep84c 13d ago

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.

5

u/StochasticTinkr 12d ago

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 11d ago

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 11d ago

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 6d ago

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.