tween icon indicating copy to clipboard operation
tween copied to clipboard

Update Readme

Open Dids opened this issue 9 years ago • 15 comments

The Readme doesn't seem to be up to date, unfortunately.

Any chance of updating it? :)

Dids avatar Sep 20 '16 18:09 Dids

Can't seem to get any of the example to work, actually.

Dids avatar Sep 20 '16 19:09 Dids

What specifically doesn't work? If I build the test with make -f test.mk it runs.

sasq64 avatar Sep 20 '16 19:09 sasq64

The code in the README uses stuff from my apone library and can't be used directly, they are more for demonstration.

sasq64 avatar Sep 20 '16 19:09 sasq64

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.

Dids avatar Sep 20 '16 20:09 Dids

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);
});

Dids avatar Sep 20 '16 20:09 Dids

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.

Dids avatar Sep 20 '16 21:09 Dids

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?

sasq64 avatar Sep 21 '16 07:09 sasq64

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.

Dids avatar Sep 21 '16 07:09 Dids

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.

Dids avatar Sep 21 '16 08:09 Dids

I'm fairly use the issue stems from this:

callback.h(16): error C2955: 'std::conditional': use of class template requires template argument list

Dids avatar Sep 21 '16 08:09 Dids

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.

Dids avatar Sep 21 '16 09:09 Dids

Did you try the very latest Visual Studio?

sasq64 avatar Sep 21 '16 11:09 sasq64

I'm on the very latest Visual Studio Community 2015, with the latest updates.

Dids avatar Sep 21 '16 12:09 Dids

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 avatar Jan 16 '17 23:01 K0j0

@K0j0 Never got it to work, sorry. :/

Dids avatar Jan 17 '17 08:01 Dids