From aa939035cbb1bc2b89f77255953b2927690e4cca Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Thu, 29 Dec 2016 19:21:24 +0200 Subject: [PATCH] Change Root::render to use the passed in Renderer --- source/root.cpp | 14 ++++++++------ source/root.h | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/source/root.cpp b/source/root.cpp index e9e62f6..b31b53f 100644 --- a/source/root.cpp +++ b/source/root.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include #include #include @@ -135,11 +136,8 @@ void Root::tick() } } -void Root::render(const GL::Tag &tag) const +void Root::render() const { - if(tag.id) - return; - GL::Bind bind_blend(GL::Blend::alpha()); GL::Renderer renderer(&camera); @@ -152,8 +150,12 @@ void Root::render(GL::Renderer &renderer, const GL::Tag &tag) const if(tag.id) return; - renderer.end(); - render(tag); + GL::Renderer::Push push(renderer); + renderer.set_camera(camera); + renderer.set_shader_program(shprog); + GL::BindRestore bind_blend(GL::Blend::alpha()); + GL::BindRestore unbind_dtest(static_cast(0)); + Widget::render(renderer); } bool Root::button_press_event(unsigned btn) diff --git a/source/root.h b/source/root.h index 5dbf7bb..7d5a592 100644 --- a/source/root.h +++ b/source/root.h @@ -63,7 +63,7 @@ public: virtual unsigned get_height() const { return geom.h; } void tick(); - virtual void render(const GL::Tag & = GL::Tag()) const; + void render() const; virtual void render(GL::Renderer &, const GL::Tag & = GL::Tag()) const; private: -- 2.45.2