2010-08-26 10:53:49 +08:00
|
|
|
#ifndef _DRAW_PRIMITIVES_TEST_H_
|
|
|
|
#define _DRAW_PRIMITIVES_TEST_H_
|
2012-04-19 14:35:52 +08:00
|
|
|
|
2012-11-21 11:43:08 +08:00
|
|
|
#include "cocos2d.h"
|
2012-04-19 14:35:52 +08:00
|
|
|
#include "../testBasic.h"
|
2013-06-07 08:12:28 +08:00
|
|
|
#include "../BaseTest.h"
|
2012-04-19 14:35:52 +08:00
|
|
|
|
2012-11-21 11:43:08 +08:00
|
|
|
#include <string>
|
|
|
|
|
2013-06-07 08:12:28 +08:00
|
|
|
class BaseLayer : public BaseTest
|
2012-11-21 11:43:08 +08:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
BaseLayer();
|
|
|
|
|
2014-02-20 10:53:49 +08:00
|
|
|
void restartCallback(Ref* sender);
|
|
|
|
void nextCallback(Ref* sender);
|
|
|
|
void backCallback(Ref* sender);
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
2012-11-21 11:43:08 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class DrawPrimitivesTest : public BaseLayer
|
2010-08-26 10:53:49 +08:00
|
|
|
{
|
|
|
|
public:
|
2012-04-19 14:35:52 +08:00
|
|
|
DrawPrimitivesTest();
|
2012-11-21 11:43:08 +08:00
|
|
|
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2014-04-08 22:07:35 +08:00
|
|
|
virtual void draw(Renderer *renderer, const Matrix &transform, bool transformUpdated) override;
|
2014-03-06 07:49:08 +08:00
|
|
|
|
2013-12-25 11:44:05 +08:00
|
|
|
protected:
|
2014-03-06 07:49:08 +08:00
|
|
|
void onDraw(const kmMat4 &transform, bool transformUpdated);
|
2013-12-26 21:19:12 +08:00
|
|
|
CustomCommand _customCommand;
|
2010-08-26 10:53:49 +08:00
|
|
|
};
|
|
|
|
|
2012-11-21 11:43:08 +08:00
|
|
|
class DrawNodeTest : public BaseLayer
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
DrawNodeTest();
|
|
|
|
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2012-11-21 11:43:08 +08:00
|
|
|
};
|
|
|
|
|
2010-08-26 10:53:49 +08:00
|
|
|
class DrawPrimitivesTestScene : public TestScene
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void runThisTest();
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|