Skip to content

Commit 3bee126

Browse files
committed
hrm, this sketchXxxx() thing sounds like a headache
1 parent c2781f6 commit 3bee126

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

core/README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,16 @@ It looks like LWJGL3 will be a nice game-centric platform (full screen, affordan
6666
LWJGL and JOGL are both great projects and we're thankful for all the work that they put in, and our own experience with Processing means that we couldn't be more sympathetic to the difficulty they face in maintaining their cross-platform, cross-chipset, cross-everything code. Like Processing, both projects are open source and created by volunteers who give their work away for free. We're enormously appreciative of their efforts.
6767

6868

69+
## `sketchRenderer()` is required
70+
Prior to Processing 3, dark magic was used to make the `size()` command work. This was done to hide an enormous amount of complexity from users. Over time, the hacks involved became untenable or just unsustainable. The process was like this:
71+
* The default renderer would be initialized offscreen and unused
72+
* `setup()` would run, and if the renderer changed, the sketch would throw an exception causing things to restart (re-calling the `setup()` method)
73+
* The previous step gave fits to any other variants of Processing (like Python or Ruby or Scala)
74+
* We had a tricky, stuttery situation where some things would happen automatically, other things would be delayed slightly
75+
In the Android version of Processing, these methods weren't possible, so we enhanced the preprocessor to parse the `size()` command used in the sketch and create methods called `sketchWidth()` and `sketchHeight()` and so on, that returned the values found in `setup()`.
76+
In Processing 3, these have moved to the desktop version of Processing as well. That means that when using Processing without the PDE (i.e. from Eclipse), it's necessary to implement these methods as well.
77+
78+
6979
## The Mess
7080

7181
The rest of this document are my notes while I'm making changes.
@@ -105,7 +115,6 @@ another PSurfaceAWT variant could allow direct rendering to the canvas (no loadP
105115

106116

107117
#### To Document
108-
- sketchRenderer() is required
109118
- the renderer class/package is used to call a static method on the PGraphics that returns the class type for the rendering surface
110119

111120
inside main, will know the screen that's being used for the app

0 commit comments

Comments
 (0)