From: Mikko Rasa Date: Thu, 29 Dec 2016 17:21:24 +0000 (+0200) Subject: Change Root::render to use the passed in Renderer X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=aa939035cbb1bc2b89f77255953b2927690e4cca;p=libs%2Fgltk.git Change Root::render to use the passed in Renderer --- 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: