rag
graphic 2d engine
Spine.h
1 #ifndef RAG_SPINE_H_
2 #define RAG_SPINE_H_
3 
4 #include <spine/spine.h>
5 #include <rag/DisplayObject.h>
6 #include <rag/Renderer.h>
7 
8 namespace rag
9 {
10  class Image;
11 }
12 
13 namespace spine
14 {
17  {
18  public:
19 
20  SkeletonDrawable(spSkeletonData* skeleton, spAnimationStateData* stateData = 0);
22 
23  virtual void logicUpdate() override;
24  virtual void render() override;
25  virtual void updateBounds(rag::DisplayObject* targetCoordinateSpace) override;
26 
27  rag::VertexArray vertexArray;
28  spSkeleton* skeleton;
29  spAnimationState* state;
30  spSkeletonBounds* skeletonBounds;
31  float timeScale;
32 
33  private:
34 
35  struct RenderState
36  {
37  rag::Image* image;
38  rag::Material::EBlendMode blendMode;
39  };
40 
41  void draw(rag::VertexArray& vertexArray, RenderState renderState);
42 
43  bool ownsAnimationStateData;
44  float* worldVertices;
45  RenderState states;
46  };
47 
48 } /* namespace spine */
49 #endif /* RAG_SPINE_H_ */
virtual void updateBounds(rag::DisplayObject *targetCoordinateSpace) override
Updates the bounding box of the object according to childs bounds.
Definition: Spine.cpp:73
virtual void render() override
Renders the DisplayObject in the screen.
Definition: Spine.cpp:93
Definition: Bitmap.h:8
virtual void logicUpdate() override
This function is called every frame.
Definition: Spine.cpp:65
Core object used to display things in screen.
Definition: DisplayObject.h:23
Definition: Spine.cpp:38
Image object.
Definition: Image.h:19
Display 2D Skeletal Animations made with the 3rd party tool Spine.
Definition: Spine.h:16