Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Particles demos #770

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 32 additions & 29 deletions processing/mode/examples/Demos/Graphics/Particles/Particles.pde
Original file line number Diff line number Diff line change
@@ -1,30 +1,33 @@
// Particles, by Daniel Shiffman

ParticleSystem ps;
PImage sprite;

void setup() {
size(displayWidth, displayHeight, P2D);
orientation(LANDSCAPE);
sprite = loadImage("sprite.png");
ps = new ParticleSystem(2000);

// Writing to the depth buffer is disabled to avoid rendering
// artifacts due to the fact that the particles are semi-transparent
// but not z-sorted.
hint(DISABLE_DEPTH_MASK);
}

void draw () {
background(0);
ps.update();
ps.display();

ps.setEmitter(mouseX,mouseY);

fill(255);
textSize(16);
text("Frame rate: " + int(frameRate),10,20);
}

// Particles, by Daniel Shiffman

ParticleSystem ps;
PImage sprite;

void settings() {
size(displayWidth, displayHeight, P2D);
}

void setup() {
orientation(LANDSCAPE);
sprite = loadImage("sprite.png");
ps = new ParticleSystem(2000);

// Writing to the depth buffer is disabled to avoid rendering
// artifacts due to the fact that the particles are semi-transparent
// but not z-sorted.
hint(DISABLE_DEPTH_MASK);
}

void draw () {
background(0);
ps.update();
ps.display();

ps.setEmitter(mouseX,mouseY);

fill(255);
textSize(16);
text("Frame rate: " + int(frameRate),10,20);
}