}
}
private synchronized void createNewBuffer(int w, int h) {
offscreenPixels = new int[w * h];
MemoryImageSource source = new MemoryImageSource(w, h, offscreenPixels, 0, w);
source.setAnimated(true);
Image n = createImage(source);
if (offscreenBuffer != null) {
// should I be copying over pixels instead?
n.getGraphics().drawImage(offscreenBuffer, 0,0,null);
}