]>
Dogcows Code - chaz/yoink/blob - src/Animation.hh
2 /*] Copyright (c) 2009-2010, Charles McGarvey [**************************
3 **] All rights reserved.
7 * Distributable under the terms and conditions of the 2-clause BSD license;
8 * see the file COPYING for a complete text of the license.
10 **************************************************************************/
12 #ifndef _ANIMATION_HH_
13 #define _ANIMATION_HH_
22 #include <boost/shared_ptr.hpp>
24 #include <moof/math.hh>
25 #include <moof/resource.hh>
29 typedef boost::shared_ptr
<Animation
> AnimationP
;
32 * A class to manage frame-based animation. Animation sequences can be
33 * loaded from file, then named sequences are started. The animation is
34 * updated periodically (each update cycle), and the correct current frame
35 * is determined. This class is generic enough that a frame can mean just
36 * about anything to whatever drawing context is used to render the frame.
39 class Animation
: public moof::resource
43 Animation(const std::string
& name
);
45 static AnimationP
alloc(const std::string
& name
)
47 return AnimationP(new Animation(name
));
51 void startSequence(const std::string
& name
);
53 void update(moof::scalar t
, moof::scalar dt
);
54 unsigned getFrame() const;
60 boost::shared_ptr
<impl
> impl_
;
64 #endif // _ANIMATION_HH_
This page took 0.043338 seconds and 4 git commands to generate.