cleaned up, added record button

This commit is contained in:
2022-06-23 00:26:10 +02:00
parent fa596c9f18
commit e2b94e116d
8 changed files with 234 additions and 276 deletions

View File

@@ -1,5 +1,4 @@
import drop.*;
import test.*;
import controlP5.*;
import java.util.*;
@@ -65,7 +64,7 @@ void setup() {
String[] args = {"SecondFrame"};
gui = new SecondApplet();
PApplet.runSketch(args, gui);
renderer = createGraphics(width, height);
viewport = createImage(renderer.width, renderer.height, ARGB);
sourceManager = new SourceManager();
@@ -79,7 +78,7 @@ void draw() {
sourceManager.update(); //will write some image to the renderer
sourceManager.setSource();
gui.shaderManager.applyShader(); //boolean animate (iterative calcs), boolean apply (draw)
background(color(0));
imageMode(CENTER);
viewport = renderer.get();
@@ -91,7 +90,6 @@ void draw() {
if (viewport.height > height) viewport.resize(0, height);
}
//sourceManager.setSource();
image(viewport, width/2, height/2);
@@ -104,5 +102,15 @@ void draw() {
if (recording) {
snapshot();
fill(#ff0000);
ellipse(width-100, height-100, 30, 30);
}
}
void snapshot() {
frameName = str(uptime);
renderer.save(dataPath("")+"/snapshots/" + frameName + ".png");
saveData[1] = "uptime = " + frameName;
println("Rendered " + frameName + ".png at " + dataPath("")+"/snapshots/ with a resolution of " + renderer.width + " x " + renderer.height);
saveStrings(dataPath("saves.sav"), saveData);
}