private static void takeScreenshot() {
		int width = Display.getWidth();
		int height = Display.getHeight();
		ByteBuffer buffer = BufferUtils.createByteBuffer(width * height * 4);
		GL11.glReadBuffer(GL11.GL_BACK);
		GL11.glReadPixels(0, 0, width, height, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, buffer);
		int[] data = new int[width * height];
		for (int i = 0; i < buffer.capacity(); i+=4) {
			int r = buffer.get(i) & 0xFF;
			int g = buffer.get(i + 1)& 0xFF;
			int b = buffer.get(i + 2)& 0xFF;
			int a = buffer.get(i + 3)& 0xFF;
			int modifier = width - (((i / 4) % width));
			data[data.length - ((i / 4 / width * width) + modifier)] = ((a << 24) + (r << 16) + (g << 8)) + b;
		}
		BufferedImage bi = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
		bi.setRGB(0, 0, width, height, data, 0, width);
		try {
			ImageIO.write(bi, "PNG", new File("screenshots/" + System.currentTimeMillis() + ".png"));
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}