@@ -0,0 +1,1352 @@
+package com.haxademic.core.render;%0A%0Aimport java.awt.image.BufferedImage;%0A%0Aimport processing.core.PApplet;%0Aimport processing.core.PImage;%0A%0Aimport com.haxademic.core.app.P;%0Aimport com.haxademic.core.image.AnimatedGifEncoder;%0Aimport com.haxademic.core.system.FileUtil;%0Aimport com.haxademic.core.system.SystemUtil;%0A%0Apublic class GifRenderer %7B%0A%0A%09public AnimatedGifEncoder encoder;%0A%09protected int _frameRate = 30;%0A%09protected int _quality = 10;%0A%09protected int _framesRendered = 0;%0A%0A%09public GifRenderer(int frameRate, int quality) %7B%0A%09%09_frameRate = frameRate;%0A%09%09_quality = quality;%0A%09%7D%0A%09%0A%09public void startGifRender(PApplet p) %7B%0A%09%09encoder = new AnimatedGifEncoder();%0A%09%09encoder.start( FileUtil.getHaxademicOutputPath() + SystemUtil.getTimestamp(p) + %22-export.gif%22 );%0A%09%09encoder.setFrameRate( _frameRate );%0A%09%09encoder.setQuality( _quality );%0A%09%09encoder.setRepeat( 0 );%0A%09%09P.println(%22== started rendering gif ==%22);%0A%09%7D%0A%09%09%0A%09public void renderGifFrame(PApplet p) %7B%0A%09%09if(encoder == null) return; // no-op if we're starting after frameCount == 1%0A%09%09_framesRendered++;%0A%09%09P.println(%22== rendering gif frame: %22+_framesRendered+%22 ==%22);%0A%09%09PImage screenshot = p.get();%0A%09%09BufferedImage newFrame = (BufferedImage) screenshot.getNative();%0A%09%09encoder.addFrame(newFrame);%0A%09%7D%0A%0A%09public void finish() %7B%0A%09%09P.println(%22== finished rendering gif ==%22);%0A%09%09encoder.finish();%0A%09%09encoder = null;%0A%09%7D%0A%7D%0A

Add gif rendering class (used in PAppletHax)