Skip to content

Commit 0c140ab

Browse files
authored
Fix typographical errors in README_MD
1 parent d429a6e commit 0c140ab

1 file changed

Lines changed: 42 additions & 37 deletions

File tree

scripts/generate_plugandplay.py

Lines changed: 42 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -94,35 +94,35 @@ def generate(out_dir: Path) -> None:
9494
README_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++.
9999
There'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
101101
it, and run one script.
102102
103103
If 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
105105
the same page you got this from, or check the project's repository. This
106106
folder 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.
112112
2. Write a sketch (see below, or copy `examples/bouncing_ball.cpp` to get
113113
started).
114114
3. Run it:
115115
116-
```sh
116+
```sh
117117
./processing-cpp/run.sh
118-
```
118+
```
119119
120120
That's the entire workflow. `run.sh` finds your `.cpp` file, compiles it
121121
against the engine, links it, and runs the result, in one step. The first
122122
time 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
124124
that 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
127127
On Windows, run `run.bat` the same way (from an MSYS2 shell, or by
128128
double-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/`
133133
and `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
137137
It can't cover `run.sh`'s other output, though: the compiled sketch
138138
itself, `.processing-cpp-build`, lands one level up, at the root of
@@ -170,8 +170,8 @@ def generate(out_dir: Path) -> None:
170170
You 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
175175
member you inherit, so you can call it directly inside your overrides
176176
without 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
191191
itself and builds them together, so a small multi-file sketch works with
192192
no 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
202202
by 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:
214214
instead. On Windows with MSYS2, it's
215215
`-lglfw3 -lglew32 -lopengl32 -lglu32 -lcomdlg32 -lshell32 -lole32 -luuid -mwindows -pthread -D_USE_MATH_DEFINES`.
216216
This 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
218218
need 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
221221
engine and a precompiled header for `Processing.h` so repeated runs are
222222
fast, as described above. Neither is required for a *working* build, only
223223
for 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:
273278
After that, **Ctrl+Shift+B** (**Cmd+Shift+B** on macOS) builds and runs
274279
your sketch. Compile errors show up in VS Code's Problems panel instead
275280
of 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,
277282
so there's nothing here that can drift out of sync with the plain
278283
command-line instructions above.
279284
280285
## License
281286
282287
The engine is licensed under the **GNU Lesser General Public License
283288
v2.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
287292
linked directly into your sketch's binary). LGPL 2.1 requires that anyone
288293
you 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
290295
object files (or this source) available alongside your binary, not just
291296
the binary itself.
292297
293298
This 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
295300
lawyer if it matters for what you're shipping. It's flagged here mainly
296301
so 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
299304
bundled 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
301306
domain (your choice), which is unrestricted enough that it doesn't add
302307
anything beyond what's already true of the LGPL 2.1 engine itself. Their
303308
full license text is included at the bottom of each of those files.
@@ -306,7 +311,7 @@ def generate(out_dir: Path) -> None:
306311
307312
This release is built by `scripts/generate_dragdrop.py` in the main
308313
CppMode 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
310315
CppMode's Processing IDE plugin compiles your sketches against. If you
311316
got this folder somewhere other than that repo, it's a snapshot of the
312317
engine at some point in time; check the repo for anything newer.
@@ -316,7 +321,7 @@ def generate(out_dir: Path) -> None:
316321
Processing-style sketch (free-standing `setup()` and `draw()` functions,
317322
no 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
320325
yourself, by hand, in a plain C++ file, produces the same program. This
321326
release just lets you start from that shape directly, without going
322327
through the IDE or the transpiler to get there.

0 commit comments

Comments
 (0)