2 #include "renderable.h"
11 delete internal_renderer;
14 View::View(View &&other):
16 content(other.content),
17 internal_renderer(other.internal_renderer)
19 other.internal_renderer = 0;
22 void View::set_camera(Camera *c)
26 camera->set_aspect_ratio(get_aspect_ratio());
29 void View::set_content(Renderable *r)
36 if(!internal_renderer)
37 internal_renderer = new Renderer;
38 internal_renderer->begin();
39 render(*internal_renderer);
40 internal_renderer->end();
43 void View::render(Renderer &renderer)
45 Renderer::Push _push(renderer);
46 renderer.set_framebuffer(&get_target());
50 renderer.set_camera(*camera);
51 content->setup_frame(renderer);
52 content->render(renderer);
53 content->finish_frame();