public void setSize(int width, int height) {
try {
pbuffer.setSize(width, height);
} catch(net.java.games.jogl.GLException gle) {
pbuffer.removeGLEventListener(this);
pbuffer = new GLPbufferImpl(ctx.createPbufferContext(glc,width,height));
initialized = false;
snapshotImage = null;
this.width = width; this.height = height;
pbuffer.addGLEventListener(this);
}