X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Froot.cpp;h=ad1ca5b7936cbef133056a0aa7296d7474055b6f;hb=7d8609bec44adcab67b0c1a78d560ef76afded8d;hp=e9e62f6785c3a203914dfb10594d1a0db74c812d;hpb=f8f2f18e886429b70325ff36989bb126de617716;p=libs%2Fgltk.git diff --git a/source/root.cpp b/source/root.cpp index e9e62f6..ad1ca5b 100644 --- a/source/root.cpp +++ b/source/root.cpp @@ -1,9 +1,9 @@ #include #include #include +#include #include #include -#include #include #include "label.h" #include "style.h" @@ -91,6 +91,12 @@ Root::~Root() void Root::tick() { + Time::TimeStamp t = Time::now(); + Time::TimeDelta dt = (last_tick ? t-last_tick : Time::zero); + last_tick = t; + + animate(dt); + if(tooltip_timeout && Time::now()>tooltip_timeout) { std::string tip; @@ -135,11 +141,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 +155,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)