mobius3 / tweeny

A modern C++ tweening library
http://mobius3.github.io/tweeny
MIT License
742 stars 53 forks source link

Error #20

Closed flamendless closed 3 years ago

flamendless commented 3 years ago

before #include "tweeny.h", <string> and <stdint.h> must be included first

//without these two, tweeny.h errors
#include <stdint.h>
#include <string>

#include "tweeny.h"

Also, if i do this auto test = tweeny::from(1.0f).to(0.0f).during(10);, can you tell me what's the equivalent of auto? i dont want to use auto

Thank you

mobius3 commented 3 years ago

Hey @flamendless thanks for your issue. #include <stdint.h> might be a problem, I'd rather include #include <cstdint>. I'll properly check the issue and fix it ASAP.

Also, if i do this auto test = tweeny::from(1.0f).to(0.0f).during(10);, can you tell me what's the equivalent of auto? i dont want to use auto

It uses the type from the argument to tweeny::from. In your case you're passing a float, you'd get tween<float>. If you pass 1.0f, 2, 10L to tweeny::from you'd get tween<float, int, long> for auto. Does that answer your question?

flamendless commented 3 years ago

@mobius3 what's the problem with stdint.h, and why prefer cstding over it?

tweeny::tween<float> works! thank you.

mobius3 commented 3 years ago

tweeny::tween works! thank you.

nice!

@mobius3 what's the problem with stdint.h, and why prefer cstding over it?

They are C++ wrappers and basically put things in the std:: namespace. See here and here. They are also deprecated in C++ (see here)

flamendless commented 3 years ago

thanks a lot!