diff --git a/java/libraries/opengl/examples/Tests/OffscreenTest/OffscreenTest.pde b/java/libraries/opengl/examples/Tests/OffscreenTest/OffscreenTest.pde new file mode 100644 index 000000000..335bdeb1e --- /dev/null +++ b/java/libraries/opengl/examples/Tests/OffscreenTest/OffscreenTest.pde @@ -0,0 +1,32 @@ +PGraphics pg; + +void setup() { + size(400, 400, P3D); + + pg = createGraphics(400, 400, P3D); + pg.smooth(4); +} + +void draw() { + background(0); + + pg.beginDraw(); + pg.background(255, 0, 0); + pg.ellipse(mouseX, mouseY, 100, 100); + pg.endDraw(); + + image(pg, 0, 0, 400, 400); +} + +void keyPressed() { + if (key == '1') pg.smooth(1); + else if (key == '2') pg.smooth(2); + else if (key == '3') pg.smooth(4); + else if (key == '4') pg.smooth(8); + else if (key == '5') pg.smooth(16); + else if (key == '6') pg.smooth(32); + else if (key == ' ') { + ((PGraphicsOpenGL)g).restartPGL(); + } +} +