public void display(){

		currentGraphics = new TreeSet<GameGraphic>(new Comparator<GameGraphic>(){
			public int compare(GameGraphic a, GameGraphic b){
				return a.layer - b.layer;
			}
		});

		dr.setCamera(this);
		
		if(default_render){
			currentGraphics = dr.getGraphics(this);
			
		}
		
		TreeMap<Integer, BufferedImage> buffs = new TreeMap<Integer, BufferedImage>();
		HashMap<Integer, Graphics2D> gs = new HashMap<Integer, Graphics2D>();
		

		Vec2u camerascale = new Vec2u(graphicWH.width/curCam.bounds.x,graphicWH.height/curCam.bounds.y);
		Vec2u scaledpos = new Vec2u(curCam.position.x*-camerascale.x,curCam.position.y*-camerascale.y);
		scaledpos = scaledpos.add(new Vec2u(graphicWH.width/2,graphicWH.height/2));
		
		
		for(GameGraphic gg : currentGraphics){
			
			
			if(buffs.get(gg.layer) == null){
				buffs.put(gg.layer, new BufferedImage(graphicWH.width, graphicWH.height, BufferedImage.TYPE_4BYTE_ABGR));
				gs.put(gg.layer, buffs.get(gg.layer).createGraphics());
			}

			AffineTransform t = gs.get(gg.layer).getTransform();

			
			if(gg.scaled){
				gs.get(gg.layer).translate(scaledpos.x, scaledpos.y);
				gs.get(gg.layer).scale(camerascale.x,camerascale.y);
				gs.get(gg.layer).rotate(curCam.angle);
			}else{
				gs.get(gg.layer).translate(0,graphicWH.height/2);
				gs.get(gg.layer).scale(1,-1);
				gs.get(gg.layer).translate(0,-graphicWH.height/2);
			}

			gg.draw(gs.get(gg.layer));
			
			gs.get(gg.layer).setTransform(t);
		}

		for(Map.Entry<Integer, Graphics2D> m : gs.entrySet()){
			m.getValue().dispose();
		}
		gs.clear();

		
		//draw layers to screen
		g = (Graphics2D) out.getDrawGraphics();

		g.setColor(Color.black);
		g.setClip(0, 0, graphicWH.width, graphicWH.height);
		g.fillRect(0,0,graphicWH.width,graphicWH.height);
		
		g.translate(0,graphicWH.height/2);
		g.scale(1,-1);
		g.translate(0,-graphicWH.height/2);

		
		for(Entry<Integer,BufferedImage> m: buffs.entrySet()){
			g.drawImage(m.getValue(), null, 0, 0);
		}
		
		g.dispose();
		out.graphicDoneCallback();
	}