2013-11-05 01:14:22 +08:00
|
|
|
//
|
|
|
|
// Created by NiTe Luo on 11/1/13.
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __NewRendererTest_H_
|
|
|
|
#define __NewRendererTest_H_
|
|
|
|
|
|
|
|
#include "cocos2d.h"
|
|
|
|
#include "../testBasic.h"
|
|
|
|
#include "../BaseTest.h"
|
|
|
|
|
2013-11-13 03:53:53 +08:00
|
|
|
#define kTagSpriteBatchNode 100
|
2013-11-16 03:29:11 +08:00
|
|
|
#define kTagClipperNode 101
|
|
|
|
#define kTagContentNode 102
|
2013-11-13 03:53:53 +08:00
|
|
|
|
2013-11-13 03:19:18 +08:00
|
|
|
class NewRendererTestScene : public TestScene
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void runThisTest();
|
|
|
|
};
|
|
|
|
|
|
|
|
class MultiSceneTest : public BaseTest
|
|
|
|
{
|
|
|
|
public:
|
2013-11-27 08:54:48 +08:00
|
|
|
CREATE_FUNC(MultiSceneTest);
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2013-11-13 03:19:18 +08:00
|
|
|
virtual void onEnter();
|
|
|
|
|
2014-02-20 10:53:49 +08:00
|
|
|
void restartCallback(Ref* sender);
|
|
|
|
void nextCallback(Ref* sender);
|
|
|
|
void backCallback(Ref* sender);
|
2013-11-27 08:54:48 +08:00
|
|
|
|
|
|
|
protected:
|
|
|
|
MultiSceneTest();
|
|
|
|
virtual ~MultiSceneTest();
|
|
|
|
|
2013-11-13 03:19:18 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class NewSpriteTest : public MultiSceneTest
|
2013-11-05 01:14:22 +08:00
|
|
|
{
|
|
|
|
public:
|
2013-11-27 08:54:48 +08:00
|
|
|
CREATE_FUNC(NewSpriteTest);
|
2013-11-13 03:19:18 +08:00
|
|
|
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2013-11-05 01:14:22 +08:00
|
|
|
|
|
|
|
void createSpriteTest();
|
|
|
|
void createNewSpriteTest();
|
|
|
|
void onTouchesEnded(const std::vector<Touch*>& touches, Event* event);
|
|
|
|
|
|
|
|
protected:
|
2013-11-27 08:54:48 +08:00
|
|
|
NewSpriteTest();
|
|
|
|
virtual ~NewSpriteTest();
|
2013-11-05 01:14:22 +08:00
|
|
|
};
|
|
|
|
|
2013-11-13 03:53:53 +08:00
|
|
|
class NewSpriteBatchTest : public MultiSceneTest
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
2013-11-27 08:54:48 +08:00
|
|
|
CREATE_FUNC(NewSpriteBatchTest);
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2013-11-13 03:53:53 +08:00
|
|
|
|
2013-12-19 03:45:30 +08:00
|
|
|
void onTouchesEnded(const std::vector<Touch*>& touches, Event* event);
|
2013-11-13 03:53:53 +08:00
|
|
|
void addNewSpriteWithCoords(Point p);
|
|
|
|
|
2013-11-27 08:54:48 +08:00
|
|
|
protected:
|
|
|
|
NewSpriteBatchTest();
|
|
|
|
virtual ~NewSpriteBatchTest();
|
2013-11-13 03:53:53 +08:00
|
|
|
};
|
|
|
|
|
2013-11-16 03:29:11 +08:00
|
|
|
class NewClippingNodeTest : public MultiSceneTest
|
|
|
|
{
|
|
|
|
public:
|
2013-11-05 01:14:22 +08:00
|
|
|
|
2013-11-27 08:54:48 +08:00
|
|
|
CREATE_FUNC(NewClippingNodeTest);
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2013-11-15 08:39:03 +08:00
|
|
|
|
2013-11-16 03:29:11 +08:00
|
|
|
void onTouchesBegan(const std::vector<Touch*>& touches, Event *event);
|
|
|
|
void onTouchesMoved(const std::vector<Touch*>& touches, Event *event);
|
|
|
|
void onTouchesEnded(const std::vector<Touch*>& touches, Event *event);
|
|
|
|
|
|
|
|
protected:
|
2013-11-27 08:54:48 +08:00
|
|
|
NewClippingNodeTest();
|
|
|
|
virtual ~NewClippingNodeTest();
|
|
|
|
|
2013-11-16 03:29:11 +08:00
|
|
|
bool _scrolling;
|
|
|
|
Point _lastPoint;
|
|
|
|
};
|
2013-11-15 08:39:03 +08:00
|
|
|
|
2013-11-20 05:57:39 +08:00
|
|
|
class NewDrawNodeTest : public MultiSceneTest
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
2013-11-27 08:54:48 +08:00
|
|
|
CREATE_FUNC(NewDrawNodeTest)
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2013-11-20 05:57:39 +08:00
|
|
|
|
|
|
|
protected:
|
2013-11-27 08:54:48 +08:00
|
|
|
NewDrawNodeTest();
|
|
|
|
virtual ~NewDrawNodeTest();
|
2013-11-20 05:57:39 +08:00
|
|
|
};
|
|
|
|
|
2013-11-27 10:35:23 +08:00
|
|
|
class NewCullingTest : public MultiSceneTest
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
CREATE_FUNC(NewCullingTest)
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2013-11-27 10:35:23 +08:00
|
|
|
|
|
|
|
protected:
|
|
|
|
NewCullingTest();
|
|
|
|
virtual ~NewCullingTest();
|
|
|
|
};
|
|
|
|
|
2014-01-15 09:03:54 +08:00
|
|
|
class VBOFullTest : public MultiSceneTest
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(VBOFullTest);
|
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
VBOFullTest();
|
|
|
|
virtual ~VBOFullTest();
|
|
|
|
};
|
|
|
|
|
2013-11-05 01:14:22 +08:00
|
|
|
#endif //__NewRendererTest_H_
|