Changed rendering to use a framebuffer