pencilBrush.setFillColor(new MTColor(0, 0, 0, 255));
//Create the frame/window that displays the drawing scene through a FBO
// final MTSceneTexture sceneWindow = new MTSceneTexture(0,0, pa, drawingScene);
//We have to create a fullscreen fbo in order to save the image uncompressed
final MTSceneTexture sceneTexture = new MTSceneTexture(pa,0, 0, pa.width, pa.height, drawingScene);
sceneTexture.getFbo().clear(true, 255, 255, 255, 0, true);
sceneTexture.setStrokeColor(new MTColor(155,155,155));
frame.addChild(sceneTexture);
//Eraser button
PImage eraser = pa.loadImage(imagesPath + "Kde_crystalsvg_eraser.png");
MTImageButton b = new MTImageButton(eraser, pa);
b.setNoStroke(true);
b.translate(new Vector3D(-50,0,0));
b.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent ae) {
switch (ae.getID()) {
case TapEvent.BUTTON_CLICKED:{
// //As we are messing with opengl here, we make sure it happens in the rendering thread
pa.invokeLater(new Runnable() {
public void run() {
sceneTexture.getFbo().clear(true, 255, 255, 255, 0, true);
}
});
}break;
default:
break;