2 #include "renderable.h"
9 View::View(Framebuffer &t):
18 delete internal_renderer;
21 void View::set_camera(Camera *c)
25 camera->set_aspect_ratio(get_aspect_ratio());
28 void View::set_content(Renderable *r)
35 if(!internal_renderer)
36 internal_renderer = new Renderer;
37 render(*internal_renderer);
38 internal_renderer->end();
41 void View::render(Renderer &renderer)
43 Renderer::Push _push(renderer);
44 renderer.set_framebuffer(&target);
48 renderer.set_camera(*camera);
49 content->setup_frame(renderer);
50 content->render(renderer);
51 content->finish_frame();