Is there a way i can stop the draw method to be called automatically.
What i'm doing currently :
public class GUI extends extends SurfaceView implements SurfaceHolder.Callback{
...
public void render() {
SurfaceHolder surfaceHolder = getHolder();
Canvas canvas = null;
try{
canvas = surfaceHolder.lockCanvas();
if (canvas != null) {
draw(canvas);
}
}finally {
if (canvas != null){
surfaceHolder.unlockCanvasAndPost(canvas);
}
}
}
@Override
public void draw(Canvas canvas){
... //things done with the canvas object
}
}
public class Game extends AbstractGame {
...
@Override
public void render(){
this.graphicsPanel.render();
}
I want the view to only redraw when i call the render method, i tried setting willNotDraw(true) and false but it makes no difference. How can i stop the surface view from drawing automatically, it seems to be drawing at average 53-59 fps which is fine but i need the rendering to be done at the end to avoid clashes with the game threads/lists