Update Readme
The Readme doesn't seem to be up to date, unfortunately.
Any chance of updating it? :)
Can't seem to get any of the example to work, actually.
What specifically doesn't work? If I build the test with make -f test.mk it runs.
The code in the README uses stuff from my apone library and can't be used directly, they are more for demonstration.
Getting a bunch of compiler errors, but I'm still trying to figure out the issue. Right now it feels like a platform specific issue (Windows). I think max macros cause issues on Windows, so I'll try getting around that first.
All of the compiler errors happened to be caused by #include "windows.h", which has it's own implementation of a max macro. This was fixed with #define NOMINMAX.
Regarding the Readme, for example this doesn't work (onUpdate doesn't exist in this case):
Tween::make().fromTo(200, 0).linear().onUpdate([](int x) {
printf("%d\n", x);
});
So far I haven't actually been able to get any of the callbacks working. Here's a small example of how I'm trying to use the library:
float y = 0;
Tween::make().to(y, 10.0f).onUpdate([](float y){}).seconds(1.0);
This produces several compiler errors, such as this:
tween.h(201): error C2668: 'utils::CallbackCaller<T &,tween::Tween,double>::callme': ambiguous call to overloaded function
1> with
1> [
1> T=float
1> ]
Here's a few others (changed the class and function that's calling Tween::make):
1>tween\callback.h(13): error C2064: term does not evaluate to a function taking 0 arguments
1> tween\callback.h(13): note: class does not define an 'operator()' or a user defined conversion operator to a pointer-to-function or reference-to-function that takes appropriate number of arguments
1> tween.h(201): note: see reference to class template instantiation 'require_fn0<MyClass::MyFunction::<lambda_464e0f6bd14e2b6655912b65bb4bc7c5>,void>' being compiled
1> MyClass.cpp(439): note: see reference to function template instantiation 'tween::TweenT<int> &tween::TweenT<int>::onUpdate<MyClass::MyFunction::<lambda_464e0f6bd14e2b6655912b65bb4bc7c5>>(F &&)' being compiled
1> with
1> [
1> F=MyClass::MyFunction::<lambda_464e0f6bd14e2b6655912b65bb4bc7c5>
1> ]
I'm fairly sure I'm just not using it properly though.
OK, I never tried it with Visual Studio, but VC is not very good at C++11 support AFAIK. Are you using the bleeding edge/latest VC you can get at least?
I am, yes. The project I'm using it in is cross-platform though, so I'll see if it'll compile on Linux or OS X instead.
I can confirm, it builds and works exactly as intended on both Linux and OS X. Hmm.
EDIT: Good news is that the library works fine on Windows if I don't use any of the callbacks, don't get any errors without them. Bad news is, I need to at least be able to trigger the onComplete callback, which fails on Windows.
I'm fairly use the issue stems from this:
callback.h(16): error C2955: 'std::conditional': use of class template requires template argument list
I'm currently working around the problem by storing references to each tweens, starting them manually, then checking if _myTween.allTweens.size() == 0, but this seems very cumbersome when compared to using lambdas.
Did you try the very latest Visual Studio?
I'm on the very latest Visual Studio Community 2015, with the latest updates.
Hey there, I'm running into this as well (on Visual Studio Community 2015). Everything runs great on OSX/Linux! I'm moving my dev setup to Windows though and would love to get this working. Any update on either of your fronts?
@K0j0 Never got it to work, sorry. :/