Fix #4638: make offscreen PGraphicsFX2D work. by GKFX · Pull Request #4698 · processing/processing

@GKFX

This was tested against OpenJFX rather than the default JavaFX since Processing was flatly refusing to compile otherwise; I assume it will work the same regardless.
Fix #4638.

@GKFX

@GKFX

BTW, you still can't use an off-screen PGraphicsFX2D in an AWT sketch because of the rule that graphics code must be limited to the FX Application Thread. My attempt to use Platform.runLater to solve this locked up my whole screen, so I gave up, but there might be a better way.

@GKFX

@benfry

What does “This was tested against OpenJFX rather than the default JavaFX since Processing was flatly refusing to compile otherwise” mean?

@GKFX

I added a line to core/build.xml to put my system copy of openjfx on the classpath. Ant otherwise couldn't find the javafx package, even with a completely clean, unmodified repository. I'll try and get you a copy of the error message tomorrow, if it's still happening. (I'm sorry for that very vague statement; I posted it in a hurry!)

@GKFX

The error is The import com.sun.javafx cannot be resolved; the full output of Ant is tmp.NBI8A4OM3v.txt.

@benfry

@JakubValtar Low priority, but perhaps you can review when you get a chance?

@martin-y-lu

Why isn't this in the current source? I added it as a separate implementation and it works perfectly.

@jeremydouglass

@Momopey -- Great that it worked for you. Can you share details about what you tested on? That might help core devs to review.

benfry added a commit to processing/processing4-javafx that referenced this pull request

Jan 16, 2022

@benfry

@benfry

@benfry

…and thanks @GKFX for the usable fix!

Made one change to only set alpha when !primaryGraphics, but otherwise the rest was more or less as-is.

@github-actions

This pull request has been automatically locked. Pull requests that have been closed are automatically locked 30 days after the last comment.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators

Jan 17, 2023