Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import processing.javafx.*;
- //import java.awt.*;
- //import javax.media.opengl.glu.GLU;
- void setup() {
- // frameRate(-1) -> max rendering speed but high CPU usage
- // - and as additional bonus we can't even limit this by ourselves
- // - we can prevent doing anything more often than 60 HZ in draw
- // - but it still renders what it has too often and consumes resources for no reason
- size(500, 500);
- frameRate(60);
- //size(500, 500, P2D);
- //frameRate(60);
- //size(500, 500, P2D);
- //frameRate(60);
- ////frameRate(-1);
- //beginPGL();
- //GLU.getCurrentGL().getGL2().setSwapInterval(1);
- //endPGL();
- //size(500, 500, P2D);
- //frameRate(240);
- //PJOGL pgl = (PJOGL) beginPGL();
- //pgl.gl.setSwapInterval(0);
- //endPGL();
- }
- void draw() {
- background(0);
- float p = millis() / 1000.0 * 3.25;
- circle(cos(p) * 100 + 250, sin(p) * 100 + 250, cos(p) * 50 + 100);
- if (frameCount % 60 == 0) {
- println("FPS: ", float(frameCount)/millis()*1000.0);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement