Gorgon Game Engine
Animations.h
Go to the documentation of this file.
1 #pragma once
2 
3 #pragma warning(disable:4250)
4 
5 #include "Drawables.h"
6 #include "../Animation.h"
7 #include "../Animation/Discrete.h"
8 #include "../Animation/Instance.h"
9 #include "../Animation/Storage.h"
10 
11 namespace Gorgon { namespace Graphics {
12 
14  class Animation : public virtual Drawable, public virtual Gorgon::Animation::Base {
15 
16  };
17 
19  class RectangularAnimation : public virtual RectangularDrawable, public virtual Animation {
20 
21  };
22 
25  };
26 
29  public:
30  virtual ~AnimationProvider() { }
31 
33 
36  virtual AnimationProvider &MoveOutProvider() override = 0;
37 
40  virtual Animation &CreateAnimation(Gorgon::Animation::ControllerBase &timer) const override = 0;
41 
44  virtual Animation &CreateAnimation(bool create=true) const override = 0;
45  };
46 
49  public:
51 
55 
59 
62  virtual RectangularAnimation &CreateAnimation(bool create=true) const override = 0;
63 
64  virtual Geometry::Size GetSize() const = 0;
65 
66  int GetWidth() const { return GetSize().Width; }
67  int GetHeight() const { return GetSize().Height; }
68  };
69 
72  public:
74 
78 
81  virtual DiscreteAnimation &CreateAnimation(bool create=true) const override = 0;
82 
83  };
84 
85  class ImageProvider : public virtual Image, public virtual RectangularAnimation, public virtual RectangularAnimationProvider {
86  public:
87 
88  ImageProvider &CreateAnimation(Gorgon::Animation::ControllerBase &) const override { return const_cast<ImageProvider &>(*this); }
89 
90  ImageProvider &CreateAnimation(bool =false) const override { return const_cast<ImageProvider &>(*this); }
91 
93  virtual void DeleteAnimation() const override { }
94 
95  using Image::GetSize;
96  using Image::GetWidth;
97  using Image::GetHeight;
98 
99  protected:
101  bool Progress(unsigned &) override { return true; }
102 
103  int GetDuration() const override { return 0; }
104 
105  };
106 
107 }
108 
109 namespace Animation {
110 
112  template<>
113  class basic_StorageInjection<Graphics::AnimationProvider> {
114  //nothing for now
115  };
116 
118  template<>
119  class basic_StorageInjection<Graphics::RectangularAnimationProvider> : public Graphics::RectangularAnimationProvider {
120 
121  //types are derived not to type the same code for every class
122  virtual auto MoveOutProvider() -> decltype(*this) override {
123  auto ret = new typename std::remove_reference<decltype(*this)>::type(std::move(*this));
124 
125  return *ret;
126  }
127 
128  virtual Graphics::RectangularAnimation &CreateAnimation(Gorgon::Animation::ControllerBase &timer) const override {
129  auto &me = dynamic_cast<const basic_Storage<Graphics::RectangularAnimationProvider>&>(*this);
130  return me.CreateAnimation(timer);
131  }
132 
133  virtual Graphics::RectangularAnimation &CreateAnimation(bool create=true) const override {
134  auto &me = dynamic_cast<const basic_Storage<Graphics::RectangularAnimationProvider>&>(*this);
135  return me.CreateAnimation(create);
136  }
137 
138  virtual Geometry::Size GetSize() const override {
139  auto &me = dynamic_cast<const basic_Storage<Graphics::RectangularAnimationProvider>&>(*this);
140  if(me.HasAnimation())
141  return me->GetSize();
142  else
143  return {0, 0};
144  }
145 
146  int GetWidth() const { return GetSize().Width; }
147  int GetHeight() const { return GetSize().Height; }
148  };
149 
151  template<>
152  class basic_StorageInjection<Graphics::DiscreteAnimationProvider> : public Graphics::DiscreteAnimationProvider {
153  public:
154  //types are derived not to type the same code for every class
155  virtual auto MoveOutProvider() -> decltype(*this) override {
156  auto ret = new typename std::remove_reference<decltype(*this)>::type(std::move(*this));
157 
158  return *ret;
159  }
160 
162  auto &me = dynamic_cast<const basic_Storage<Graphics::DiscreteAnimationProvider>&>(*this);
163  return me.CreateAnimation(timer);
164  }
165 
166  virtual Graphics::DiscreteAnimation &CreateAnimation(bool create=true) const override {
167  auto &me = dynamic_cast<const basic_Storage<Graphics::DiscreteAnimationProvider>&>(*this);
168  return me.CreateAnimation(create);
169  }
170 
171  virtual Geometry::Size GetSize() const override {
172  auto &me = dynamic_cast<const basic_Storage<Graphics::DiscreteAnimationProvider>&>(*this);
173  if(me.HasAnimation())
174  return me->GetSize();
175  else
176  return {0, 0};
177  }
178 
179 
180  virtual void Add(const Frame &frame) override {
181  auto &me = dynamic_cast<basic_Storage<Graphics::DiscreteAnimationProvider>&>(*this);
182  if(me.HasAnimation())
183  me->Add(frame);
184  }
185 
186  virtual void Insert(const Frame &frame, int before) override {
187  auto &me = dynamic_cast<basic_Storage<Graphics::DiscreteAnimationProvider>&>(*this);
188  if(me.HasAnimation())
189  me->Insert(frame, before);
190  }
191 
192  virtual void MoveBefore(unsigned index, int before) override {
193  auto &me = dynamic_cast<basic_Storage<Graphics::DiscreteAnimationProvider>&>(*this);
194  if(me.HasAnimation())
195  me->MoveBefore(index, before);
196  }
197 
198  virtual void Remove(unsigned index) override {
199  auto &me = dynamic_cast<basic_Storage<Graphics::DiscreteAnimationProvider>&>(*this);
200  if(me.HasAnimation())
201  me->Remove(index);
202  }
203 
204  virtual const Frame &FrameAt(int index) const override {
205  auto &me = dynamic_cast<const basic_Storage<Graphics::DiscreteAnimationProvider>&>(*this);
206  if(me.HasAnimation())
207  return me->FrameAt(index);
208  else
209  throw std::runtime_error("Animation storage is empty");
210  }
211 
212  virtual unsigned StartOf(unsigned frame) const override {
213  auto &me = dynamic_cast<const basic_Storage<Graphics::DiscreteAnimationProvider>&>(*this);
214  if(me.HasAnimation())
215  return me->StartOf(frame);
216  else
217  return -1;
218  }
219 
220  virtual unsigned GetDuration() const override {
221  auto &me = dynamic_cast<const basic_Storage<Graphics::DiscreteAnimationProvider>&>(*this);
222  if(me.HasAnimation())
223  return me->GetDuration();
224  else
225  return 0;
226  }
227 
228  virtual unsigned GetDuration(unsigned frame) const override {
229  auto &me = dynamic_cast<const basic_Storage<Graphics::DiscreteAnimationProvider>&>(*this);
230  if(me.HasAnimation())
231  return me->GetDuration(frame);
232  else
233  return 0;
234  }
235 
236  virtual void Clear() override {
237  auto &me = dynamic_cast<basic_Storage<Graphics::DiscreteAnimationProvider>&>(*this);
238  if(me.HasAnimation())
239  me->Clear();
240  }
241 
242  virtual int GetCount() const override {
243  auto &me = dynamic_cast<const basic_Storage<Graphics::DiscreteAnimationProvider>&>(*this);
244  if(me.HasAnimation())
245  return me->GetCount();
246  else
247  return 0;
248  }
249  };
250 
251  template<>
252  class basic_InstanceInjection<Graphics::RectangularAnimation> : public Graphics::RectangularAnimation {
253  public:
254  virtual bool Progress(unsigned &leftover) override {
255  auto &me = dynamic_cast<const basic_Instance<Graphics::RectangularAnimation>&>(*this);
256  if(me.HasAnimation())
257  return me->Progress(leftover);
258  else
259  return true;
260  }
261 
262  int GetDuration() const override {
263  auto &me = dynamic_cast<const basic_Instance<Graphics::RectangularAnimation>&>(*this);
264  if(me.HasAnimation())
265  return me.GetDuration();
266  else
267  return 0;
268  }
269 
270  virtual void SetController(ControllerBase &controller) override {
271  auto &me = dynamic_cast<const basic_Instance<Graphics::RectangularAnimation>&>(*this);
272  if(me.HasAnimation())
273  return me->SetController(controller);
274  }
275 
276  virtual bool HasController() const override {
277  auto &me = dynamic_cast<const basic_Instance<Graphics::RectangularAnimation>&>(*this);
278  if(me.HasAnimation())
279  return me->HasController();
280  else
281  return false;
282  }
283 
284  virtual ControllerBase &GetController() const override {
285 #ifndef NDEBUG
286  if(!HasController()) {
287  throw std::runtime_error("Animation does not have a controller");
288  }
289 #endif
290  auto &me = dynamic_cast<const basic_Instance<Graphics::RectangularAnimation>&>(*this);
291  return me->GetController();
292  }
293 
294  virtual void RemoveController() override {
295  auto &me = dynamic_cast<const basic_Instance<Graphics::RectangularAnimation>&>(*this);
296  if(me.HasAnimation())
297  return me->RemoveController();
298  }
299 
300 
301  protected:
302  virtual void draw(Graphics::TextureTarget &target, const Geometry::Pointf &p, Graphics::RGBAf color) const override {
303  auto &me = dynamic_cast<const basic_Instance<Graphics::RectangularAnimation>&>(*this);
304  if(me.HasAnimation())
305  me->Draw(target, p, color);
306  }
307 
308  virtual void draw(Graphics::TextureTarget &target, const Geometry::Pointf &p1, const Geometry::Pointf &p2,
309  const Geometry::Pointf &p3, const Geometry::Pointf &p4,
310  const Geometry::Pointf &tex1, const Geometry::Pointf &tex2,
311  const Geometry::Pointf &tex3, const Geometry::Pointf &tex4, Graphics::RGBAf color) const override
312  {
313  auto &me = dynamic_cast<const basic_Instance<Graphics::RectangularAnimation>&>(*this);
314  if(me.HasAnimation())
315  me->Draw(target, p1, p2, p3, p4, tex1, tex2, tex3, tex4, color);
316  }
317 
318  virtual void draw(Graphics::TextureTarget &target, const Geometry::Pointf &p1, const Geometry::Pointf &p2,
319  const Geometry::Pointf &p3, const Geometry::Pointf &p4, Graphics::RGBAf color) const override
320  {
321  auto &me = dynamic_cast<const basic_Instance<Graphics::RectangularAnimation>&>(*this);
322  if(me.HasAnimation())
323  me->Draw(target, p1, p2, p3, p4);
324  }
325 
326  virtual void drawstretched(Graphics::TextureTarget &target, const Geometry::Rectanglef &r, Graphics::RGBAf color) const override {
327  auto &me = dynamic_cast<const basic_Instance<Graphics::RectangularAnimation>&>(*this);
328  if(me.HasAnimation())
329  me->DrawStretched(target, r, color);
330  }
331 
332  virtual void drawin(Graphics::TextureTarget &target, const Geometry::Rectanglef &r, Graphics::RGBAf color) const override {
333  auto &me = dynamic_cast<const basic_Instance<Graphics::RectangularAnimation>&>(*this);
334  if(me.HasAnimation())
335  me->DrawIn(target, r, color);
336  }
337 
338  virtual void drawin(Graphics::TextureTarget &target, const Graphics::SizeController &controller, const Geometry::Rectanglef &r, Graphics::RGBAf color) const override {
339  auto &me = dynamic_cast<const basic_Instance<Graphics::RectangularAnimation>&>(*this);
340  if(me.HasAnimation())
341  me->DrawIn(target, controller, r, color);
342  }
343 
344  virtual Geometry::Size calculatesize(const Geometry::Size &area) const override {
345  auto &me = dynamic_cast<const basic_Instance<Graphics::RectangularAnimation>&>(*this);
346  if(me.HasAnimation())
347  return me->CalculateSize(area);
348  else
349  return {0, 0};
350  }
351 
352  virtual Geometry::Size calculatesize(const Graphics::SizeController &controller, const Geometry::Size &s) const override {
353  auto &me = dynamic_cast<const basic_Instance<Graphics::RectangularAnimation>&>(*this);
354  if(me.HasAnimation())
355  return me->CalculateSize(controller, s);
356  else
357  return {0, 0};
358  }
359 
360  virtual Geometry::Size getsize() const override {
361  auto &me = dynamic_cast<const basic_Instance<Graphics::RectangularAnimation>&>(*this);
362  if(me.HasAnimation())
363  return me->GetSize();
364  else
365  return {0, 0};
366  }
367  };
368 
369 }
370 
371 namespace Graphics {
372 
377 
378 } }
Gorgon::Animation::DiscreteAnimation
Definition: Discrete.h:8
Gorgon::Animation::Base::GetDuration
virtual int GetDuration() const =0
Returns the duration of the animation if it is a known apriori.
Gorgon::Animation::basic_StorageInjection< Graphics::DiscreteAnimationProvider >::CreateAnimation
virtual Graphics::DiscreteAnimation & CreateAnimation(Gorgon::Animation::ControllerBase &timer) const override
This function should create a new animation with the given controller and if owner parameter is set t...
Definition: Animations.h:161
Gorgon::Animation::basic_Storage
This class stores animations as a part of itself so that it can be moved around as a value rather tha...
Definition: Storage.h:21
Gorgon::Animation::basic_InstanceInjection< Graphics::RectangularAnimation >::drawin
virtual void drawin(Graphics::TextureTarget &target, const Geometry::Rectanglef &r, Graphics::RGBAf color) const override
This function should draw the object to the target area.
Definition: Animations.h:332
Gorgon::Graphics::SizeController
This class allows control over a sizable object.
Definition: Graphics.h:161
Gorgon::Animation::basic_StorageInjection< Graphics::DiscreteAnimationProvider >::CreateAnimation
virtual Graphics::DiscreteAnimation & CreateAnimation(bool create=true) const override
This function should create and animation and depending on the create parameter, it should create its...
Definition: Animations.h:166
Gorgon::Animation::basic_InstanceInjection< Graphics::RectangularAnimation >::GetController
virtual ControllerBase & GetController() const override
Returns the controller of this animation.
Definition: Animations.h:284
Gorgon::Animation::basic_StorageInjection< Graphics::DiscreteAnimationProvider >::GetDuration
virtual unsigned GetDuration(unsigned frame) const override
Returns the duration of the given frame.
Definition: Animations.h:228
Gorgon::Animation::basic_Instance
This class allows storing an animation instance regarless of its underlying type as a value.
Definition: Instance.h:20
Gorgon::Animation::basic_StorageInjection< Graphics::DiscreteAnimationProvider >::MoveOutProvider
virtual auto MoveOutProvider() -> decltype(*this) override
This function moves this animation provider into a new provider.
Definition: Animations.h:155
Gorgon::Animation::basic_StorageInjection< Graphics::DiscreteAnimationProvider >::GetSize
virtual Geometry::Size GetSize() const override
Definition: Animations.h:171
Gorgon::Animation::basic_StorageInjection< Graphics::DiscreteAnimationProvider >::Insert
virtual void Insert(const Frame &frame, int before) override
Adds a frame to the specified point the animation.
Definition: Animations.h:186
Gorgon::Animation::basic_InstanceInjection< Graphics::RectangularAnimation >::calculatesize
virtual Geometry::Size calculatesize(const Geometry::Size &area) const override
This function should return the size of the object when it is requested to be drawn in the given area...
Definition: Animations.h:344
Gorgon::Graphics::AnimationProvider
A regular drawable animation provider.
Definition: Animations.h:28
Gorgon::Graphics::AnimationProvider::CreateAnimation
virtual Animation & CreateAnimation(bool create=true) const override=0
This function should create and animation and depending on the create parameter, it should create its...
Gorgon::Animation::ControllerBase
Controllers are required to progress animations.
Definition: Animation.h:65
Gorgon::Animation::basic_StorageInjection< Graphics::DiscreteAnimationProvider >::StartOf
virtual unsigned StartOf(unsigned frame) const override
Returns the starting time of the given frame.
Definition: Animations.h:212
Gorgon::Animation::basic_StorageInjection< Graphics::DiscreteAnimationProvider >::Add
virtual void Add(const Frame &frame) override
Adds a frame to the end of the animation.
Definition: Animations.h:180
Gorgon::Geometry::basic_Size::Height
T_ Height
Height of this size object.
Definition: Size.h:261
Drawables.h
Gorgon::Animation::basic_StorageInjection< Graphics::DiscreteAnimationProvider >::GetCount
virtual int GetCount() const override
Returns number of frames.
Definition: Animations.h:242
Gorgon::Animation::basic_InstanceInjection< Graphics::RectangularAnimation >::RemoveController
virtual void RemoveController() override
Removes the controller of this animation.
Definition: Animations.h:294
Gorgon::Graphics::RGBAf
Represents a four channel 32 bit float per channel color information.
Definition: Color.h:373
Gorgon::Graphics::RectangularAnimationProvider::CreateAnimation
virtual RectangularAnimation & CreateAnimation(bool create=true) const override=0
This function should create and animation and depending on the create parameter, it should create its...
Gorgon::Animation::basic_InstanceInjection< Graphics::RectangularAnimation >::draw
virtual void draw(Graphics::TextureTarget &target, const Geometry::Pointf &p1, const Geometry::Pointf &p2, const Geometry::Pointf &p3, const Geometry::Pointf &p4, const Geometry::Pointf &tex1, const Geometry::Pointf &tex2, const Geometry::Pointf &tex3, const Geometry::Pointf &tex4, Graphics::RGBAf color) const override
This method should draw to object inside the given quad with the given texture coordinates.
Definition: Animations.h:308
Gorgon::Graphics::RectangularAnimationProvider::GetWidth
int GetWidth() const
Definition: Animations.h:66
Gorgon::Animation::basic_StorageInjection< Graphics::DiscreteAnimationProvider >::FrameAt
virtual const Frame & FrameAt(int index) const override
Returns the frame at specific point.
Definition: Animations.h:204
Gorgon::Graphics::ImageProvider::Progress
bool Progress(unsigned &) override
When used as animation, an image is always persistent and it never finishes.
Definition: Animations.h:101
Gorgon::Graphics::RectangularAnimationProvider::GetHeight
int GetHeight() const
Definition: Animations.h:67
Gorgon::Graphics::DiscreteAnimationProvider
This class provides discrete and rectangular animation which is suitable for bitmap and texture anima...
Definition: Animations.h:71
Gorgon::Graphics::ImageProvider::CreateAnimation
ImageProvider & CreateAnimation(Gorgon::Animation::ControllerBase &) const override
This function should create a new animation with the given controller and if owner parameter is set t...
Definition: Animations.h:88
Gorgon::Animation::basic_Storage::Remove
void Remove()
Removes the animation stored in the container, if the container owns the animation,...
Definition: Storage.h:103
Gorgon
Root namespace for Gorgon Game Engine.
Definition: Any.h:19
Gorgon::Geometry::basic_Size
This class represents a 2D geometric size.
Definition: Size.h:23
Gorgon::Animation::basic_InstanceInjection< Graphics::RectangularAnimation >::SetController
virtual void SetController(ControllerBase &controller) override
Sets the controller to the given controller.
Definition: Animations.h:270
Gorgon::Graphics::AnimationProvider::CreateAnimation
virtual Animation & CreateAnimation(Gorgon::Animation::ControllerBase &timer) const override=0
This function should create a new animation with the given controller and if owner parameter is set t...
Gorgon::Animation::Provider
This interface marks a class as animation provider.
Definition: Animation.h:283
Gorgon::Animation::basic_InstanceInjection< Graphics::RectangularAnimation >::Progress
virtual bool Progress(unsigned &leftover) override
This function should progress the animation.
Definition: Animations.h:254
Gorgon::Graphics::AnimationProvider::MoveOutProvider
virtual AnimationProvider & MoveOutProvider() override=0
This function moves this animation provider into a new provider.
Gorgon::Graphics::RectangularAnimationProvider::MoveOutProvider
virtual RectangularAnimationProvider & MoveOutProvider() override=0
This function moves this animation provider into a new provider.
Gorgon::Animation::Base
This is the base class for all animations.
Definition: Animation.h:306
Gorgon::Graphics::Image
This is an interface for solid texture based image.
Definition: Drawables.h:511
Gorgon::Graphics::RectangularAnimation
Rectangular drawable animation.
Definition: Animations.h:19
Gorgon::Animation::basic_InstanceInjection< Graphics::RectangularAnimation >::draw
virtual void draw(Graphics::TextureTarget &target, const Geometry::Pointf &p1, const Geometry::Pointf &p2, const Geometry::Pointf &p3, const Geometry::Pointf &p4, Graphics::RGBAf color) const override
This function should draw the object inside the given quad.
Definition: Animations.h:318
Gorgon::Graphics::ImageProvider::CreateAnimation
ImageProvider & CreateAnimation(bool=false) const override
This function should create and animation and depending on the create parameter, it should create its...
Definition: Animations.h:90
Gorgon::Animation::basic_InstanceInjection< Graphics::RectangularAnimation >::draw
virtual void draw(Graphics::TextureTarget &target, const Geometry::Pointf &p, Graphics::RGBAf color) const override
This function should draw the object to the given point.
Definition: Animations.h:302
Gorgon::Animation::basic_StorageInjection< Graphics::DiscreteAnimationProvider >::GetDuration
virtual unsigned GetDuration() const override
Returns the duration of the animation.
Definition: Animations.h:220
Gorgon::Animation::DiscreteProvider
Provides a discreet animation that is made out of frames.
Definition: Discrete.h:45
Gorgon::Resource::GID::Animation
constexpr Type Animation
Definition: GID.h:187
Gorgon::Animation::basic_StorageInjection< Graphics::DiscreteAnimationProvider >::Clear
virtual void Clear() override
Clears all frames from this animation.
Definition: Animations.h:236
Gorgon::Animation::basic_StorageInjection
Specializing this class allows code injection to animation storages.
Definition: Storage.h:13
Gorgon::Graphics::TextureTarget
This interface defines a class that can be used as a common target for texture based drawing.
Definition: TextureTargets.h:12
Gorgon::Geometry::basic_Point
This class represents a 2D point.
Definition: Point.h:32
Gorgon::Graphics::RectangularAnimationProvider::CreateAnimation
virtual RectangularAnimation & CreateAnimation(Gorgon::Animation::ControllerBase &timer) const override=0
This function should create a new animation with the given controller and if owner parameter is set t...
Gorgon::Graphics::DiscreteAnimationProvider::CreateAnimation
virtual DiscreteAnimation & CreateAnimation(Gorgon::Animation::ControllerBase &timer) const override=0
This function should create a new animation with the given controller and if owner parameter is set t...
Gorgon::Animation::basic_InstanceInjection< Graphics::RectangularAnimation >::drawin
virtual void drawin(Graphics::TextureTarget &target, const Graphics::SizeController &controller, const Geometry::Rectanglef &r, Graphics::RGBAf color) const override
This function should draw this drawable inside the given rectangle according to the given controller.
Definition: Animations.h:338
Gorgon::Graphics::DiscreteAnimationProvider::CreateAnimation
virtual DiscreteAnimation & CreateAnimation(bool create=true) const override=0
This function should create and animation and depending on the create parameter, it should create its...
Gorgon::Graphics::AnimationProvider::~AnimationProvider
virtual ~AnimationProvider()
Definition: Animations.h:30
Gorgon::Graphics::Animation
A regular drawable animation.
Definition: Animations.h:14
Gorgon::Graphics::RectangularDrawable::GetSize
const Geometry::Size GetSize() const
Returns the size of this object.
Definition: Drawables.h:443
Gorgon::Animation::basic_StorageInjection< Graphics::DiscreteAnimationProvider >::Remove
virtual void Remove(unsigned index) override
Removes the given frame.
Definition: Animations.h:198
Gorgon::Graphics::RectangularAnimationProvider
This class provides rectangular animations.
Definition: Animations.h:48
Gorgon::Animation::Base::HasController
virtual bool HasController() const
Returns whether this animation has a controller.
Definition: Animation.h:344
Gorgon::Animation::basic_StorageInjection< Graphics::DiscreteAnimationProvider >::MoveBefore
virtual void MoveBefore(unsigned index, int before) override
Moves the frame with the given index to the specified point the animation.
Definition: Animations.h:192
Gorgon::Animation::basic_Storage::CreateAnimation
virtual A_::AnimationType & CreateAnimation(ControllerBase &timer) const override
This function creates a new animation from the stored animation provider.
Definition: Storage.h:129
Gorgon::Graphics::RectangularAnimationProvider::GetSize
virtual Geometry::Size GetSize() const =0
Gorgon::UI::Graphics
@ Graphics
Definition: Template.h:164
Gorgon::Graphics::RectangularDrawable
Definition: Drawables.h:74
Gorgon::Animation::basic_InstanceInjection< Graphics::RectangularAnimation >::HasController
virtual bool HasController() const override
Returns whether this animation has a controller.
Definition: Animations.h:276
Gorgon::Animation::Base::RemoveController
virtual void RemoveController()
Removes the controller of this animation.
Definition: Animation.h:357
Gorgon::Graphics::ImageProvider::DeleteAnimation
virtual void DeleteAnimation() const override
if used as animation, this object will not be deleted
Definition: Animations.h:93
Gorgon::Graphics::RectangularDrawable::GetHeight
int GetHeight() const
Returns the height of the drawable.
Definition: Drawables.h:451
Gorgon::Graphics::DiscreteAnimation
A discrete rectangular animation, this is most suitable for bitmap or texture animations.
Definition: Animations.h:24
Gorgon::Geometry::basic_Size::Width
T_ Width
Width of this size object.
Definition: Size.h:258
Gorgon::Graphics::Drawable
Represents a drawable object, that can be drawn to the given point.
Definition: Drawables.h:17
Gorgon::Animation::Base::Progress
virtual bool Progress(unsigned &leftover)=0
This function should progress the animation.
Gorgon::Animation::Base::SetController
virtual void SetController(ControllerBase &controller)
Sets the controller to the given controller.
Definition: Animation.h:334
Gorgon::Graphics::ImageProvider::GetDuration
int GetDuration() const override
Returns the duration of the animation if it is a known apriori.
Definition: Animations.h:103
Gorgon::Graphics::RectangularDrawable::GetWidth
int GetWidth() const
Returns the width of the drawable.
Definition: Drawables.h:448
Gorgon::Animation::basic_InstanceInjection< Graphics::RectangularAnimation >::drawstretched
virtual void drawstretched(Graphics::TextureTarget &target, const Geometry::Rectanglef &r, Graphics::RGBAf color) const override
This function should draw the object to the target area.
Definition: Animations.h:326
Gorgon::Animation::basic_InstanceInjection< Graphics::RectangularAnimation >::GetDuration
int GetDuration() const override
Returns the duration of the animation if it is a known apriori.
Definition: Animations.h:262
Gorgon::Animation::basic_InstanceInjection< Graphics::RectangularAnimation >::calculatesize
virtual Geometry::Size calculatesize(const Graphics::SizeController &controller, const Geometry::Size &s) const override
This function should return the size of the object when it is requested to be drawn in the given area...
Definition: Animations.h:352
Gorgon::Geometry::basic_Rectangle
Represents a rectangle in a 2D space.
Definition: Rectangle.h:19
Gorgon::Animation::basic_InstanceInjection< Graphics::RectangularAnimation >::getsize
virtual Geometry::Size getsize() const override
Should return the exact size of this object.
Definition: Animations.h:360
Gorgon::Graphics::ImageProvider
Definition: Animations.h:85
Gorgon::Animation::Base::GetController
virtual ControllerBase & GetController() const
Returns the controller of this animation.
Definition: Animation.h:347
Gorgon::Animation::Frame
This is the base class for a single frame in a discreet animation.
Definition: Discrete.h:20
Gorgon::Animation::basic_InstanceInjection
Specializing this class allows code injection to animation instances.
Definition: Instance.h:11