Files
processing4/android/examples/OpenGL/Tests/RestartTest/RestartTest.pde
2012-05-09 23:58:30 +00:00

27 lines
399 B
Plaintext

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