CommandBuff.h 810 B

123456789101112131415161718192021222324252627282930
  1. #ifndef RED_BAKE_COMMAND_BUFF_H_
  2. #define RED_BAKE_COMMAND_BUFF_H_
  3. #include "cocos2d.h"
  4. #include <vector>
  5. class CommandBuff {
  6. public:
  7. static CommandBuff* getInstance ();
  8. static void destroyInstance ();
  9. void update (float delta);
  10. cocos2d::TrianglesCommand* addCommand(cocos2d::Renderer* renderer, float globalOrder, cocos2d::Texture2D* texture, cocos2d::GLProgramState* glProgramState, cocos2d::BlendFunc blendType, const cocos2d::TrianglesCommand::Triangles& triangles, const cocos2d::Mat4& mv, uint32_t flags);
  11. protected:
  12. CommandBuff ();
  13. ~CommandBuff();
  14. void reset ();
  15. cocos2d::TrianglesCommand* nextFreeCommand ();
  16. // pool of commands
  17. std::vector<cocos2d::TrianglesCommand*> _commandsPool;
  18. uint32_t _nextFreeCommand;
  19. };
  20. #endif // RED_BAKE_COMMAND_BUFF_H_