]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/root.cpp
Add a system for animating widgets
[libs/gltk.git] / source / root.cpp
index b31b53f2d7e2f767cd48fb253eef5e436afdb863..ad1ca5b7936cbef133056a0aa7296d7474055b6f 100644 (file)
@@ -4,7 +4,6 @@
 #include <msp/gl/tests.h>
 #include <msp/gl/uniform.h>
 #include <msp/input/keys.h>
-#include <msp/time/units.h>
 #include <msp/time/utils.h>
 #include "label.h"
 #include "style.h"
@@ -92,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;