Hello everyone,
Is there a good way to run a sketch at a low resolution, say with size(640, 480), but then run that low resolution size at a full screen size? In addition it would be important to be able to run on a second monitor. I’ve created a sketch that eats up frames at high resolutions, and I’m wondering if there is a way to still get a fullscreen display but process less pixels.
Thank you.
Here is the sketch in case that helps:
PShape ellipse; // The PShape object
float scale = 1;
int[] lfoIncrement = {1, 1, 1, 1};
//true feedback variables
PImage[] feedbackBuffer = new PImage[100];
int feedbackCount = 1;
int feedbackMax;
//i'm adding this now
int feedbackDelay = 10;
float feedbackLevel = 0;
float addBright = 0;
void setup() {
//fullScreen(P2D);
size(640, 480, P2D);
for (int i = 0; i < feedbackBuffer.length; i++) {
feedbackBuffer[i] = createImage(width, height, RGB);
}
//feedbackDelay = feedbackBuffer.length;
}
void draw() {
background(0);
ellipse = createShape(ELLIPSE, 0, 0, width, height);
//ellipse.translate(width/2, height/2);
ellipse.setStroke(color(255, 255, 255, 255));
ellipse.setFill(color(0, 0, 0, 0));
feedbackDisplay(feedbackBuffer[feedbackCount]);
feedbackLevel = map(mouseX, 0, width, 0, 1);
feedbackDelay = int(map(mouseY, 0, height, 1, 100));
//int size = int(map(mouseY, 0, height, 0, height)) * 2;
scale = lfo(scale, 0.01, 1);
ellipse.scale(scale * 2);
int rotate = 0;
ellipse.rotateZ(radians(rotate));
rotate = (rotate + 2) % 360;
shape(ellipse, width/2, height/2);
shape(ellipse, 0, 0);
shape(ellipse, width, 0);
shape(ellipse, 0, height);
shape(ellipse, width , height);
println(frameRate);
feedbackCapture(feedbackBuffer[feedbackCount]);
feedbackCount = ((feedbackCount + 1) % feedbackDelay);
}
//Feedback Functions
void feedbackDisplay(PImage output) {
tint(255, (255 * (feedbackLevel + addBright)));
image(output, 0, 0);
}
void feedbackCapture(PImage output) {
loadPixels();
output.loadPixels();
for (int x = 0; x < width; x++) {
for (int y = 0; y < height; y++) {
int location = x + (y * width);
output.pixels[location] = pixels[location];
}
}
output.updatePixels();
updatePixels();
}
float lfo(float input, float speed, int lfoNumber) {
if(input >= 1) {
lfoIncrement[lfoNumber] = -1;
} else if(input <= -1) {
lfoIncrement[lfoNumber] = 1;
}
input = input + (lfoIncrement[lfoNumber] * speed);
return input;
}