cocos2dx
中的一些Protocols
,其实就是接口啦。应该是和obj-c
里面的protocol
关键字有关系。
路径
代码
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
| class CC_DLL __RGBAProtocol { public: virtual ~__RGBAProtocol() {} virtual void setColor(const Color3B& color) = 0; virtual const Color3B& getColor() const = 0; virtual const Color3B& getDisplayedColor() const = 0; virtual GLubyte getDisplayedOpacity() const = 0; virtual GLubyte getOpacity() const = 0; virtual void setOpacity(GLubyte opacity) = 0; virtual void setOpacityModifyRGB(bool value) = 0; virtual bool isOpacityModifyRGB() const = 0; virtual bool isCascadeColorEnabled() const = 0; virtual void setCascadeColorEnabled(bool cascadeColorEnabled) = 0; virtual void updateDisplayedColor(const Color3B& color) = 0; virtual bool isCascadeOpacityEnabled() const = 0; virtual void setCascadeOpacityEnabled(bool cascadeOpacityEnabled) = 0; virtual void updateDisplayedOpacity(GLubyte opacity) = 0; };
class CC_DLL BlendProtocol { public: virtual ~BlendProtocol() {}
virtual void setBlendFunc(const BlendFunc &blendFunc) = 0; virtual const BlendFunc &getBlendFunc() const = 0; };
class CC_DLL TextureProtocol : public BlendProtocol { public: virtual ~TextureProtocol() {} virtual Texture2D* getTexture() const = 0;
virtual void setTexture(Texture2D *texture) = 0; };
class CC_DLL LabelProtocol { public: virtual ~LabelProtocol() {}
virtual void setString(const std::string &label) = 0; virtual const std::string& getString() const = 0; };
class CC_DLL DirectorDelegate { public: virtual ~DirectorDelegate() {} virtual void updateProjection() = 0; };
|
总结
这几日在看iOS iTunes公开课 & OpenGL SuperBible 6th,权当是顺便学英语吧。