You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: build/windows/fenster/README.md
+30-6Lines changed: 30 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,11 +10,9 @@ Generally speaking, this is a nightmare to deal with. The solution, starting in
10
10
With those values in hand, the sketch sets the `sun.java2d.uiScale` to either 1 or 2. Using fractional values produces [ugly results](https://github.com/processing/processing4/issues/378). Similarly, we do not set uiScale to 3 when scaling is at 300%. If you want larger sketches, use `scale()` in your code.
11
11
12
12
13
-
# Approaches
14
-
15
13
## Using AWT
16
14
17
-
The [Toolkit.getScreenResolution()](https://docs.oracle.com/javase/8/docs/api/java/awt/Toolkit.html#getScreenResolution--) method does what we want, but as soon as any AWT calls are made, it's no longer possible to set the property for `sun.java2d.uiScale` once AWT calls have been made.
15
+
The [`Toolkit.getScreenResolution()`](https://docs.oracle.com/javase/8/docs/api/java/awt/Toolkit.html#getScreenResolution--) method does what we want, but it's not possible to set the property for sun.java2d.uiScale once AWT calls have been made.
18
16
19
17
20
18
## Use a helper application
@@ -26,13 +24,15 @@ This was done by first doing the JNI setup with MSYS2, and then adding a line to
26
24
27
25
## Use JNI
28
26
29
-
* A long explanation of a lot of this that might be helpful for someone, though didn't use it
This was the intended approach, however the result works 3 times in 5, has an immediate `segmentation fault` another 20% of the time, and the rest of the time just hangs completely until a force quit. If anyone can fix it, [let us know](https://github.com/processing/processing4/issues).
28
+
29
+
* Used this really helpful tutorial for JNI
30
+
*<https://www.baeldung.com/jni>
31
31
32
32
33
33
### Building the JNI code
34
34
35
-
* Install MSYS2 from <https://www.msys2.org/>.
35
+
* Install MSYS2 from <https://www.msys2.org/> via <https://www.mingw-w64.org/downloads/#msys2>
36
36
37
37
* Within an MSYS shell, run updates and install `gcc`
38
38
@@ -47,6 +47,16 @@ This was done by first doing the JNI setup with MSYS2, and then adding a line to
47
47
*<https://stackoverflow.com/a/51775636>
48
48
* other approaches for it <https://gist.github.com/ssfang/e52c00cd446081cd72a982a2dd8634d4#file-readme-md> (section under “jni with cygwin gcc”)
49
49
50
+
* To cross compile on macOS, use:
51
+
52
+
brew install mingw-w64
53
+
54
+
This installs `g++` as `x86_64-w64-mingw32-g++`.
55
+
56
+
Did not use this approach because it would require Windows testing anyway, so it has limited utility.
57
+
58
+
A link to the formula: <https://formulae.brew.sh/formula/mingw-w64>
59
+
50
60
51
61
### Windows Reference
52
62
@@ -59,6 +69,14 @@ Resources for the necessary API calls on Windows
0 commit comments