GAF Library
Generic Animation Format
 All Classes Functions Pages
GAFSpriteWithAlpha.h
1 #pragma once
2 
3 #ifndef __GAF_SPRITE_WITH_ALPHA__
4 #define __GAF_SPRITE_WITH_ALPHA__
5 
6 #include "GAFSprite.h"
7 
10 class GAFBlurFilterData;
11 
13 {
14 private:
15  void _setBlendingFunc();
16  GLfloat m_colorTransform[8]; // 0-3 mults, 4-7 offsets
17 
18  GLfloat m_colorMatrixIdentity1[16];
19  GLfloat m_colorMatrixIdentity2[4];
20 
21  GAFColorColorMatrixFilterData* m_colorMatrixFilterData;
22  GAFGlowFilterData* m_glowFilterData;
23  GAFBlurFilterData* m_blurFilterData;
24 
25  cocos2d::Texture2D * m_initialTexture;
26  cocos2d::Rect m_initialTextureRect;
27  cocos2d::RenderTexture* m_filter;
28 
29  cocos2d::RenderTexture* _test();
30 
31 public:
34  virtual void setUniformsForFragmentShader();
35  virtual bool initWithTexture(cocos2d::Texture2D *pTexture, const cocos2d::Rect& rect, bool rotated);
36 
37  cocos2d::GLProgram * programForShader();
38 
39  void setColorTransform(const GLfloat * mults, const GLfloat * offsets);
40  const GLfloat * getColorTransform() const;
41 
42  void setColorTransform(const GLfloat * colorTransform);
43 
44  void setColorMarixFilterData(GAFColorColorMatrixFilterData* data);
45  void setGlowFilterData(GAFGlowFilterData* data);
46  void setBlurFilterData(GAFBlurFilterData* data);
47 
48  cocos2d::Texture2D* getInitialTexture() const;
49  const cocos2d::Rect& getInitialTextureRect() const;
50 
51  bool isCTXIdentity() const;
52 
53  virtual void draw(cocos2d::Renderer *renderer, const cocos2d::Mat4 &transform, bool transformUpdated) override;
54 protected:
55  void updateTextureWithEffects();
56 
57 };
58 
59 #endif // __GAF_SPRITE_WITH_ALPHA__
Definition: GAFSprite.h:23
Definition: GAFFilterData.h:29
Definition: GAFFilterData.h:38
Definition: GAFFilterData.h:48
Definition: GAFSpriteWithAlpha.h:12