Ult3D
Implementation of "Ultimate 3D Game Engine Design & Architecture" by Allan Sherrod
Loading...
Searching...
No Matches
Effect.h
Go to the documentation of this file.
1#ifndef ULT_EFFECT_H_INCLUDED
2#define ULT_EFFECT_H_INCLUDED
3
5
6#define ULT_EFFECT_HANDLE Ult::Handle<Ult::EffectResourceTag>
7#define ULT_EFFECT_RESOURCE_MANAGER Ult::ResourceManager<Ult::EffectResource,ULT_EFFECT_HANDLE>
8
9namespace Ult
10{
11
15
17{
18}; // empty in book
19
24class Effect
25{
26public:
30 Effect() {}
34 virtual ~Effect() {
35 Release();
36 }
37
42 virtual void ApplyEffect() = 0;
43
47 virtual void Release()
48 {}
49};
50
56{
57public:
63 mEffect(effect)
64 {}
65
68 virtual ~EffectResource() {
69 FreeMemory();
70 }
71
73 Effect* GetEffect() { return mEffect; }
74
75private:
76 Effect* mEffect;
77
78 void FreeMemory() {
79 if (mEffect) {
80 delete mEffect;
81 }
82 mEffect = nullptr;
83 }
84};
85
86} // namespace Ult
87
88#endif // ULT_EFFECT_H_INCLUDED
89
Definition Effect.h:25
virtual ~Effect()
Definition Effect.h:34
Effect()
Definition Effect.h:30
virtual void ApplyEffect()=0
virtual void Release()
Definition Effect.h:47
virtual ~EffectResource()
Definition Effect.h:68
Effect * GetEffect()
Definition Effect.h:73
EffectResource(Effect *effect)
Definition Effect.h:62
Definition Effect.h:17
Definition Archive.h:13