Created
September 6, 2016 14:49
-
-
Save rcurtis/2e69817fe250f51a7b4d4bc7f5da620d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "tweeny.h" | |
#include <cstdio> | |
bool print(tweeny::tween<int> &, int x) { | |
printf("%d\n", x); return false; | |
} | |
void main() | |
{ | |
printf("infinite loop example\n"); | |
auto infinitetween = tweeny::from(0).to(100).during(5).onStep(print); | |
infinitetween.onStep([](tweeny::tween<int> & t, int) { if (t.progress() >= 1.0f) t.seek(0); return false; }); | |
for (int i = 0; i <= 20; i++) infinitetween.step(1); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment