Pointers for update Animation

When refactoring the animation update. I know this is probably out of the scope of this beginner course, but would this be an example of when using pointers would be more beneficial? Since we are overwriting the scarfy data but also passing it into the function.
///////////////////////////

1 Like

It’d likely be a tiny bit more efficient to use a signature like void updateAnimation(AnimData* data, float deltaTime, int maxFrame) and pass animation data in as a pointer.

But for a project as small as this you’re not going to notice any improvement, and we want to ease students into concepts as we go (we do talk about and use pointers in Classy Clash).

2 Likes

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms