FX2D is better than P2D

If you want to use GLSL and a pressure library, use P2D.

If not, use FX2D, because:

  • Rounded Rectangles in rect(100,100,200,200,25); look incredibly weird, if you want clear strokes. (compare it using FX2D / Default renderer & OPENGL, it looks different)
    image

  • Key Presses in OPENGL behave completly different then in the default renderer or FX2D (hard to describe, try example), example:

import processing.javafx.*;

String inputString = "";

void setup() {
  size(400, 200, FX2D); //try P2D or FX2D
}

void draw() {
  background(220);
  fill(0);
  textSize(24);
  text(inputString, 20, 40);
}

void keyTyped() {
  inputString = inputString + key;
}
  • Cursors are the OPENGL default ones, and when used multiple times in one draw call, they start to glitch.
void setup() {
  size(400, 400, P2D);
}

void draw() {
  background(220);
  cursor(ARROW);
  cursor(ARROW);
  cursor(ARROW);
  noCursor();
}

Why not use the default renderer? Because FX2D gives a performance increase like P2D, but doesn’t behave like OPENGL.

This is making it hard to develop something cool, due to these features being needed to develop a good functioning application.

I wish the processing devs (if its processings fault for these errors) would change some of the OPENGL functionalities. They probably can’t do anything about some of the stuff.

I don’t wanna bash OPENGL, but it annoys me, and i had to let it out.

These “perks” have been tested on Windows & Linux.

Happy coding :slight_smile:

1 Like

Sounds good. How do I install javafx in processing 4.3?
Cheers,
Adrian.

How do I install javafx in processing 4.3?

Install the Library:

1 Like