Flushing immediate mode geometry when blend mode changes. shape() calls also flushes any remaining geometry.

This commit is contained in:
codeanticode
2011-12-06 20:45:04 +00:00
parent edb28d8f19
commit 864e2c2149
2 changed files with 73 additions and 58 deletions
@@ -23,15 +23,16 @@ void draw() {
tint(255, 255);
image(pic1, 0, 0, pic1.width, pic1.height);
screenBlend(selMode);
blendMode(selMode);
tint(255, picAlpha);
image(pic2, 0, 0, pic2.width, pic2.height);
screenBlend(REPLACE);
blendMode(REPLACE);
fill(200, 50, 50);
rect(0, height - 50, map(picAlpha, 0, 255, 0, width), 50);
fill(255);
fill(255);
text("Selected blend mode: " + name + ". Click to move to next", 10, pic1.height + 30);
text("Drag this bar to change alpha of image", 10, height - 18);
}
@@ -76,4 +77,4 @@ void mouseDragged() {
if (height - 50 < mouseY) {
picAlpha = int(map(mouseX, 0, width, 0, 255));
}
}
}