How to change renderer to OPENGL when using PApplet within a Swing context?
in
Programming Questions
•
3 years ago
Dear Forum,
I'm writing some Java code in which I'm adding a PApplet to a JPanel. This works fine. I instantiate a new PApplet, add it to the Container, call the init() method and voila, it does everything a normal processing patch would do.
...except... I can't change the rendering method to OpenGL. Using the size(w, h, renderer) method within the setup throws a NullPointerException.
Trying "g = makeGraphics(getWidth(),getHeight(),P3D,null,true);" in the setup works for P3D, but when I substitute the P3D for OPENGL I get some "Invalid memory access".
So, it would be awesome if anybody can tell me how to do this..
I'm writing some Java code in which I'm adding a PApplet to a JPanel. This works fine. I instantiate a new PApplet, add it to the Container, call the init() method and voila, it does everything a normal processing patch would do.
...except... I can't change the rendering method to OpenGL. Using the size(w, h, renderer) method within the setup throws a NullPointerException.
Trying "g = makeGraphics(getWidth(),getHeight(),P3D,null,true);" in the setup works for P3D, but when I substitute the P3D for OPENGL I get some "Invalid memory access".
So, it would be awesome if anybody can tell me how to do this..
1