NullPointerException when calling save() after surface.setSize() in P2D

This is a bug for the P2D renderer. However, fixing this does not mean you should use it that way. I wouldn’t. I mean, you are resizing your main canvas twice per drawing cycle. This is like saying your display hardware is able to chance its display settings 60 times per second.

If you explain your use case, somebody in the community could share alternative options.

Thank you for opening the bug.

Kf