Added screenshot function. Fixed AMD bug.

Prepared code for framebuffer cube maps.