Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void run() {
- Rect dstRect = new Rect();
- long startTime = System.nanoTime();
- while(running) {
- if(!holder.getSurface().isValid())
- continue;
- float deltaTime = (System.nanoTime()-startTime) / 1000000000.0f;
- startTime = System.nanoTime();
- game.getCurrentScreen().update(deltaTime);
- game.getCurrentScreen().present(deltaTime);
- Canvas canvas = holder.lockCanvas();
- canvas.getClipBounds(dstRect);
- canvas.drawBitmap(framebuffer, null, dstRect, null);
- holder.unlockCanvasAndPost(canvas);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement