123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- #ifndef __SKYBOX_H__
- #define __SKYBOX_H__
- #include "base/ccTypes.h"
- #include "platform/CCPlatformMacros.h"
- #include "renderer/CCCustomCommand.h"
- #include "2d/CCNode.h"
- NS_CC_BEGIN
- class TextureCube;
- class CC_DLL Skybox : public Node
- {
- public:
- CREATE_FUNC(Skybox);
-
-
- static Skybox* create(const std::string& positive_x, const std::string& negative_x,
- const std::string& positive_y, const std::string& negative_y,
- const std::string& positive_z, const std::string& negative_z);
-
- void setTexture(TextureCube*);
-
- virtual void draw(Renderer* renderer, const Mat4& transform, uint32_t flags) override;
-
- void reload();
- CC_CONSTRUCTOR_ACCESS:
-
- Skybox();
-
- virtual ~Skybox();
-
- virtual bool init() override;
-
-
- bool init(const std::string& positive_x, const std::string& negative_x,
- const std::string& positive_y, const std::string& negative_y,
- const std::string& positive_z, const std::string& negative_z);
- protected:
-
- void initBuffers();
- void onDraw(const Mat4& transform, uint32_t flags);
- GLuint _vao;
- GLuint _vertexBuffer;
- GLuint _indexBuffer;
- CustomCommand _customCommand;
- TextureCube* _texture;
- private:
- CC_DISALLOW_COPY_AND_ASSIGN(Skybox);
- };
- NS_CC_END
- #endif
|