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);
40 void View::render(Renderer &renderer)
42 Bind bind_fbo(target);
46 Renderer::Push push(renderer);
48 renderer.set_camera(*camera);
49 content->setup_frame(renderer);
50 content->render(renderer);
51 content->finish_frame();
52 renderer.flush_shader_data();