@@ -94,35 +94,35 @@ def generate(out_dir: Path) -> None:
9494README_MD = '''\
9595 # processing-cpp (plug-and-play)
9696
97- This is [Processing](https://processing.org)'s API -- `size()`, `ellipse()`,
98- `mouseX`, `draw()`, and the rest of it -- implemented natively in C++.
97+ This is [Processing](https://processing.org)'s API — `size()`, `ellipse()`,
98+ `mouseX`, `draw()`, and the rest of it — implemented natively in C++.
9999There's no Processing IDE involved, no `.pde` files, no transpiler, and no
100- build system to set up. You unzip this folder, write a `.cpp` file next to
100+ build system to set up. Unzip this folder, write a `.cpp` file next to
101101it, and run one script.
102102
103103If you're already building your project with CMake, you probably want the
104- separate CMake release instead -- look for `processing-cpp-cmake.zip` on
104+ separate CMake release instead — look for `processing-cpp-cmake.zip` on
105105the same page you got this from, or check the project's repository. This
106106folder doesn't need CMake at all, and isn't meant to be used with it.
107107
108108## Quick start
109109
110- 1. Unzip this folder into your project, however you like -- as
110+ 1. Unzip this folder into your project, however you like — as
111111 `processing-cpp/` sitting next to your own code is the usual way.
1121122. Write a sketch (see below, or copy `examples/bouncing_ball.cpp` to get
113113 started).
1141143. Run it:
115115
116- ```sh
116+ ```sh
117117 ./processing-cpp/run.sh
118- ```
118+ ```
119119
120120That's the entire workflow. `run.sh` finds your `.cpp` file, compiles it
121121against the engine, links it, and runs the result, in one step. The first
122122time you run it, it also compiles the engine itself and precompiles
123- `Processing.h`, which together take about 15-20 seconds; every run after
123+ `Processing.h`, which together take about 15-20 seconds. Every run after
124124that reuses both of those and only has to compile your own file, so it's
125- fast -- well under a second on most machines.
125+ fast — well under a second on most machines.
126126
127127On Windows, run `run.bat` the same way (from an MSYS2 shell, or by
128128double-clicking it).
@@ -131,8 +131,8 @@ def generate(out_dir: Path) -> None:
131131
132132`run.sh` caches its build outputs in two places: `processing-cpp/lib/`
133133and `processing-cpp/include/Processing.h.gch`. This folder already
134- includes a `.gitignore` covering both of those , so they won't get
135- committed if you run `git add processing-cpp`.
134+ includes a `.gitignore` covering both, so they won't get committed if you
135+ run `git add processing-cpp`.
136136
137137It can't cover `run.sh`'s other output, though: the compiled sketch
138138itself, `.processing-cpp-build`, lands one level up, at the root of
@@ -170,8 +170,8 @@ def generate(out_dir: Path) -> None:
170170You inherit from `PApplet`, override whichever lifecycle methods you need
171171(`setup`, `draw`, `mousePressed`, `keyPressed`, and so on), and call
172172`.run()` in `main()`. Everything in the
173- [Processing reference](https://processing.org/reference) -- `background()`,
174- `fill()`, `circle()`, `mouseX`, `width`, `height` -- is available as a
173+ [Processing reference](https://processing.org/reference) — `background()`,
174+ `fill()`, `circle()`, `mouseX`, `width`, `height` — is available as a
175175member you inherit, so you can call it directly inside your overrides
176176without writing `Processing::` in front of it.
177177
@@ -190,22 +190,22 @@ def generate(out_dir: Path) -> None:
190190`run.sh` with no arguments picks up every `.cpp` file it finds next to
191191itself and builds them together, so a small multi-file sketch works with
192192no extra effort. If you want to be explicit, or your files live somewhere
193- else, just list them:
193+ else, list them directly :
194194
195195```sh
196196./processing-cpp/run.sh main.cpp app.cpp
197197```
198198
199199## What's actually happening under the hood
200200
201- `run.sh` isn't doing anything magic -- it runs the same command you'd type
201+ `run.sh` isn't doing anything magic — it runs the same command you'd type
202202by hand, with the right flags already filled in for your operating system:
203203
204204```sh
205- g++ -std=c++2c -I include main.cpp \\
206- src/Processing.cpp src/Processing_defaults.cpp \\
207- -DPROCESSING_HAS_STB_IMAGE -DPROCESSING_HAS_STB_TRUETYPE \\
208- -lglfw -lGLEW -lGL -lGLU -lm -pthread \\
205+ g++ -std=c++2c -I include main.cpp \
206+ src/Processing.cpp src/Processing_defaults.cpp \
207+ -DPROCESSING_HAS_STB_IMAGE -DPROCESSING_HAS_STB_TRUETYPE \
208+ -lglfw -lGLEW -lGL -lGLU -lm -pthread \
209209 -o my_sketch && ./my_sketch
210210```
211211
@@ -214,14 +214,19 @@ def generate(out_dir: Path) -> None:
214214instead. On Windows with MSYS2, it's
215215`-lglfw3 -lglew32 -lopengl32 -lglu32 -lcomdlg32 -lshell32 -lole32 -luuid -mwindows -pthread -D_USE_MATH_DEFINES`.
216216This is mostly useful if you want to wire processing-cpp into your own
217- Makefile, editor build task, or something other than `run.sh` -- you don't
217+ Makefile, editor build task, or something other than `run.sh` — you don't
218218need to read this section to just use the library.
219219
220- (`run.sh` itself does a little more than this -- it caches the compiled
220+ (`run.sh` itself does a little more than this — it caches the compiled
221221engine and a precompiled header for `Processing.h` so repeated runs are
222222fast, as described above. Neither is required for a *working* build, only
223223for a *fast* one; the command above is enough to get a sketch running.)
224224
225+ ## Requirements
226+
227+ Any recent g++ or clang with C++2c support works. All three major
228+ platforms are supported: Linux, macOS, and Windows via MSYS2.
229+
225230## Installing GLFW, GLEW, and a compiler
226231
227232```sh
@@ -241,23 +246,23 @@ def generate(out_dir: Path) -> None:
241246## The two examples included here
242247
243248- **`examples/bouncing_ball.cpp`** is the sketch shown above, with a
244- little more in it -- an orange ball bouncing around the window, space
249+ little more in it — an orange ball bouncing around the window, space
245250 bar reverses it. Try it with:
246251
247- ```sh
252+ ```sh
248253 ./processing-cpp/run.sh processing-cpp/examples/bouncing_ball.cpp
249- ```
254+ ```
250255
251256- **`examples/embedding/`** shows how to drop a sketch into a project
252257 that already exists, without the rest of that project ever needing to
253258 know GLFW, GLEW, or `PApplet` exist. The `PApplet` subclass and the
254- `#include "Processing.h"` live only inside `app.cpp`; `main.cpp` -- and
255- by extension the rest of a real project -- only sees `app.h`'s plain
259+ `#include "Processing.h"` live only inside `app.cpp`; `main.cpp` — and
260+ by extension the rest of a real project — only sees `app.h`'s plain
256261 `run_particle_view()` function. Try it with:
257262
258- ```sh
263+ ```sh
259264 ./processing-cpp/run.sh processing-cpp/examples/embedding/main.cpp processing-cpp/examples/embedding/app.cpp
260- ```
265+ ```
261266
262267## Using this from VS Code instead of a terminal
263268
@@ -273,31 +278,31 @@ def generate(out_dir: Path) -> None:
273278After that, **Ctrl+Shift+B** (**Cmd+Shift+B** on macOS) builds and runs
274279your sketch. Compile errors show up in VS Code's Problems panel instead
275280of as raw terminal text. The task doesn't do anything `run.sh` doesn't
276- already do -- it just calls `run.sh` (or `run.bat` on Windows) for you,
281+ already do — it just calls `run.sh` (or `run.bat` on Windows) for you,
277282so there's nothing here that can drift out of sync with the plain
278283command-line instructions above.
279284
280285## License
281286
282287The engine is licensed under the **GNU Lesser General Public License
283288v2.1** (see `LICENSE`). LGPL is meant to allow linking from proprietary
284- software, unlike plain GPL, but it does come with real obligations --
285- notably around static linking, which is what `run.sh`/`run.bat` do here
286- by default (the engine gets compiled into `lib/libprocessing_cpp.a` and
289+ software, unlike plain GPL, but it comes with real obligations, notably
290+ around static linking, which is what `run.sh`/`run.bat` do here by
291+ default (the engine gets compiled into `lib/libprocessing_cpp.a` and
287292linked directly into your sketch's binary). LGPL 2.1 requires that anyone
288293you distribute that binary to be able to relink it against a modified
289- version of the engine -- in practice, that means making the engine's
294+ version of the engine. In practice, that means making the engine's
290295object files (or this source) available alongside your binary, not just
291296the binary itself.
292297
293298This isn't legal advice, and the specifics depend on how you're
294- distributing your project -- read `LICENSE` itself, and talk to an actual
299+ distributing your project. Read `LICENSE` itself, and talk to an actual
295300lawyer if it matters for what you're shipping. It's flagged here mainly
296301so it doesn't come as a surprise after the fact.
297302
298303`include/stb_image.h`, `stb_image_write.h`, and `stb_truetype.h` are
299304bundled third-party libraries (by Sean Barrett and contributors), not
300- part of the engine -- they 're each dual-licensed under MIT or public
305+ part of the engine. They 're each dual-licensed under MIT or public
301306domain (your choice), which is unrestricted enough that it doesn't add
302307anything beyond what's already true of the LGPL 2.1 engine itself. Their
303308full license text is included at the bottom of each of those files.
@@ -306,7 +311,7 @@ def generate(out_dir: Path) -> None:
306311
307312This release is built by `scripts/generate_dragdrop.py` in the main
308313CppMode repo, and it's generated directly from that repo's real engine
309- source (`src/Processing.h`, `src/Processing.cpp`) -- the very same code
314+ source (`src/Processing.h`, `src/Processing.cpp`) — the very same code
310315CppMode's Processing IDE plugin compiles your sketches against. If you
311316got this folder somewhere other than that repo, it's a snapshot of the
312317engine at some point in time; check the repo for anything newer.
@@ -316,7 +321,7 @@ def generate(out_dir: Path) -> None:
316321Processing-style sketch (free-standing `setup()` and `draw()` functions,
317322no class) and mechanically rewrites it into exactly the
318323`struct Sketch : public PApplet { ... }; sketch.run();` shape shown above.
319- There's no hidden behavior in that translation -- writing that shape
324+ There's no hidden behavior in that translation. Writing that shape
320325yourself, by hand, in a plain C++ file, produces the same program. This
321326release just lets you start from that shape directly, without going
322327through the IDE or the transpiler to get there.
0 commit comments