public static void main(String[] args) throws SlickException {
		new AppGameContainer(new StateFreeGame("CameraTest"){

			private Camera cam;
			private Vector2i loc;
			
			@Override
			public void renderProcess(GameContainer arg0, Graphics arg1) {
				
				cam.draw(arg0,arg1);
				arg1.setColor(Color.gray);
				arg1.fillRect(10, 500, 100, 100);
				arg1.setColor(Color.red);
				arg1.fillRect(10, 10, 100, 100);
				arg1.setColor(Color.green);
				arg1.fillRect(700,40,100,100);
				arg1.setColor(Color.white);
				arg1.fillRect(700, 500, 100, 100);
				arg1.setColor(Color.magenta);
				arg1.fillRect(400, 400, 100, 100);
				
				arg1.setColor(Color.blue);
				arg1.fillOval(loc.getX(), loc.getY(), 10, 10);
				
			}

			@Override
			public void initProcess(GameContainer arg0) {
				cam = new Camera(CameraSettings.DEFAULT);
				cam.registerCameraInput(arg0.getInput());
				loc = new Vector2i(400,300);
			}

			@Override
			public void updateProcess(GameContainer arg0, int arg1) {
				//uncomment to make the camera follow loc.
				//cam.track(loc);
				
				if (arg0.getInput().isKeyDown(Input.KEY_ESCAPE))
					arg0.exit();
				
				//note that y axis seems to be inverted.
				if (arg0.getInput().isKeyDown(Input.KEY_DOWN))
					loc.add(new Vector2i(0,1));
				if (arg0.getInput().isKeyDown(Input.KEY_UP))
					loc.add(new Vector2i(0,-1));
				if (arg0.getInput().isKeyDown(Input.KEY_LEFT))
					loc.add(new Vector2i(-1,0));
				if (arg0.getInput().isKeyDown(Input.KEY_RIGHT))
					loc.add(new Vector2i(1,0));
				
				//panning --comment if you're going to cam.track
				if (arg0.getInput().isKeyDown(Input.KEY_W))
					cam.move(Camera.Direction.UP);
				if (arg0.getInput().isKeyDown(Input.KEY_A))
					cam.move(Camera.Direction.LEFT);
				if (arg0.getInput().isKeyDown(Input.KEY_S))
					cam.move(Camera.Direction.DOWN);
				if (arg0.getInput().isKeyDown(Input.KEY_D))
					cam.move(Camera.Direction.RIGHT);
				
			}},800,600,false).start();
	}