Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions java/src/processing/mode/java/runner/Runner.java
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,18 @@ public boolean launchVirtualMachine(boolean present, String[] args) {
}


// the results of `build.sketchRunner()` returns a string without being checked so this is actually a code-smell.
// This function should not exist.
// In a better world as I understand it now, we should be making some fixes in the PreProcessor
// There are two things to consider at this moment:
// When we use the constant P2D or P3D there is actually no check for converting this into the PConstant.* value.
// So it doesn't actually do anything. WEBGPU actually does do something which led to this function.
// TODO: Lets try to remove this function, or create something that considers P2D and P3D
// This will lead to cleaning up the PreProcessor and help us learn its architecture so we can move towards a healthy refactor.
static private boolean isWebGPU(String renderer) {
return "WEBGPU".equals(renderer) || PConstants.WEBGPU.equals(renderer);
}

protected StringList getMachineParams() {
StringList params = new StringList();

Expand Down Expand Up @@ -343,7 +355,7 @@ protected StringList getMachineParams() {
//params.append("-Dcom.apple.mrj.application.apple.menu.about.name=" +
// build.getSketchClassName());

if (PConstants.WEBGPU.equals(build.getSketchRenderer())) {
if (isWebGPU(build.getSketchRenderer())) {
params.append("-XstartOnFirstThread");
}
}
Expand Down Expand Up @@ -518,7 +530,7 @@ protected StringList getSketchParams(boolean present, String[] args) {
// Only disable AWT for the WebGPU renderer, which uses GLFW and
// cannot coexist with AWT. All other renderers still depend on AWT
// for display detection, displayWidth/displayHeight, pixelDensity(), etc.
if (PConstants.WEBGPU.equals(build.getSketchRenderer())) {
if (isWebGPU(build.getSketchRenderer())) {
params.append(PApplet.ARGS_DISABLE_AWT);
}

Expand Down
Loading