canvas.setIgnoreRepaint(true);
canvas.createBufferStrategy(NUM_BUFFERS);
bufferStrategy = canvas.getBufferStrategy();
keyboard = new SimpleKeyboard();
canvas.addKeyListener(keyboard);
mouse = new SimpleMouse();
canvas.addMouseListener(mouse);
canvas.addMouseMotionListener(mouse);