Files
processing4/java/examples/OpenGL/Tests/RestartTest/RestartTest.pde
2012-07-20 20:24:58 +00:00

26 lines
471 B
Plaintext

PShape cube;
public void setup() {
size(400, 400, P3D);
cube = createShape(BOX, 100);
}
public void draw() {
background(120);
lights();
translate(mouseX, mouseY);
rotateX(frameCount * 0.01f);
rotateY(frameCount * 0.01f);
shape(cube);
}
public void keyPressed() {
// Restarts the OpenGL surface. Automatically
// recreates all the current GL resources.
((PGraphicsOpenGL)g).restartPGL();
}