2011-07-20 15:35:20 +08:00
|
|
|
#ifndef __TEXTURE2D_TEST_H__
|
|
|
|
#define __TEXTURE2D_TEST_H__
|
|
|
|
|
|
|
|
#include "../testBasic.h"
|
2013-06-07 08:12:28 +08:00
|
|
|
#include "../BaseTest.h"
|
2011-07-20 15:35:20 +08:00
|
|
|
|
2012-03-26 16:46:23 +08:00
|
|
|
|
2013-06-07 08:12:28 +08:00
|
|
|
class TextureDemo : public BaseTest
|
2011-07-20 15:35:20 +08:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual ~TextureDemo();
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
virtual void onEnter();
|
|
|
|
|
|
|
|
void restartCallback(CCObject* pSender);
|
|
|
|
void nextCallback(CCObject* pSender);
|
|
|
|
void backCallback(CCObject* pSender);
|
|
|
|
};
|
|
|
|
|
2012-05-25 10:58:28 +08:00
|
|
|
class TextureTIFF : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual std::string title();
|
|
|
|
virtual void onEnter();
|
|
|
|
};
|
|
|
|
|
2011-07-20 15:35:20 +08:00
|
|
|
class TexturePNG : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual std::string title();
|
|
|
|
virtual void onEnter();
|
|
|
|
};
|
|
|
|
|
|
|
|
class TextureJPEG : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual std::string title();
|
|
|
|
|
2013-02-05 11:37:13 +08:00
|
|
|
virtual void onEnter();
|
|
|
|
};
|
|
|
|
|
|
|
|
class TextureWEBP : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual std::string title();
|
|
|
|
|
2011-07-20 15:35:20 +08:00
|
|
|
virtual void onEnter();
|
|
|
|
};
|
|
|
|
|
|
|
|
class TextureMipMap : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
virtual void onEnter();
|
|
|
|
};
|
|
|
|
|
|
|
|
class TexturePVR : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual std::string title();
|
|
|
|
|
|
|
|
virtual void onEnter();
|
|
|
|
};
|
|
|
|
|
|
|
|
class TexturePVR2BPP : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual std::string title();
|
|
|
|
|
|
|
|
virtual void onEnter();
|
|
|
|
};
|
|
|
|
|
|
|
|
class TexturePVR4BPP : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual std::string title();
|
|
|
|
|
|
|
|
virtual void onEnter();
|
|
|
|
};
|
|
|
|
|
|
|
|
class TexturePVRRGBA8888 : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual std::string title();
|
|
|
|
|
|
|
|
virtual void onEnter();
|
|
|
|
};
|
|
|
|
|
|
|
|
class TexturePVRBGRA8888 : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual std::string title();
|
|
|
|
|
|
|
|
virtual void onEnter();
|
|
|
|
};
|
|
|
|
|
|
|
|
class TexturePVRRGBA4444 : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual std::string title();
|
|
|
|
|
|
|
|
virtual void onEnter();
|
|
|
|
};
|
|
|
|
|
|
|
|
class TexturePVRRGBA4444GZ : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
virtual void onEnter();
|
|
|
|
};
|
|
|
|
|
|
|
|
class TexturePVRRGBA4444CCZ : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
virtual void onEnter();
|
|
|
|
};
|
|
|
|
|
|
|
|
class TexturePVRRGBA5551 : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual std::string title();
|
|
|
|
|
|
|
|
virtual void onEnter();
|
|
|
|
};
|
|
|
|
|
|
|
|
class TexturePVRRGB565 : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual std::string title();
|
|
|
|
|
|
|
|
virtual void onEnter();
|
|
|
|
};
|
|
|
|
|
2012-03-23 18:16:47 +08:00
|
|
|
class TexturePVRRGB888 : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual std::string title();
|
|
|
|
virtual void onEnter();
|
|
|
|
};
|
|
|
|
|
2011-07-20 15:35:20 +08:00
|
|
|
class TexturePVRA8 : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual std::string title();
|
|
|
|
|
|
|
|
virtual void onEnter();
|
|
|
|
};
|
|
|
|
|
|
|
|
class TexturePVRI8 : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual std::string title();
|
|
|
|
|
|
|
|
virtual void onEnter();
|
|
|
|
};
|
|
|
|
|
|
|
|
class TexturePVRAI88 : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual std::string title();
|
|
|
|
|
|
|
|
virtual void onEnter();
|
|
|
|
};
|
|
|
|
|
2012-11-20 10:42:03 +08:00
|
|
|
class TexturePVR2BPPv3 : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
virtual void onEnter();
|
|
|
|
};
|
|
|
|
|
|
|
|
class TexturePVRII2BPPv3 : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
virtual void onEnter();
|
|
|
|
};
|
|
|
|
|
|
|
|
class TexturePVR4BPPv3 : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
virtual void onEnter();
|
|
|
|
};
|
|
|
|
|
|
|
|
class TexturePVRII4BPPv3 : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
virtual void onEnter();
|
|
|
|
};
|
|
|
|
|
|
|
|
class TexturePVRRGBA8888v3 : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
virtual void onEnter();
|
|
|
|
};
|
|
|
|
|
|
|
|
class TexturePVRBGRA8888v3 : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
virtual void onEnter();
|
|
|
|
};
|
|
|
|
|
|
|
|
class TexturePVRRGBA4444v3 : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
virtual void onEnter();
|
|
|
|
};
|
|
|
|
|
|
|
|
class TexturePVRRGBA5551v3 : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
virtual void onEnter();
|
|
|
|
};
|
|
|
|
|
|
|
|
class TexturePVRRGB565v3 : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
virtual void onEnter();
|
|
|
|
};
|
|
|
|
|
|
|
|
class TexturePVRRGB888v3 : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
virtual void onEnter();
|
|
|
|
};
|
|
|
|
|
|
|
|
class TexturePVRA8v3 : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
virtual void onEnter();
|
|
|
|
};
|
|
|
|
|
|
|
|
class TexturePVRI8v3 : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
virtual void onEnter();
|
|
|
|
};
|
|
|
|
|
|
|
|
class TexturePVRAI88v3 : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
virtual void onEnter();
|
|
|
|
};
|
|
|
|
|
2011-07-20 15:35:20 +08:00
|
|
|
class TexturePVRBadEncoding : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
virtual void onEnter();
|
|
|
|
};
|
|
|
|
|
|
|
|
class TexturePVRMipMap : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
virtual void onEnter();
|
|
|
|
};
|
|
|
|
|
|
|
|
class TexturePVRMipMap2 : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
virtual void onEnter();
|
|
|
|
};
|
|
|
|
|
|
|
|
class TexturePVRNonSquare : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
virtual void onEnter();
|
|
|
|
};
|
|
|
|
|
|
|
|
class TexturePVRNPOT4444 : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
virtual void onEnter();
|
|
|
|
};
|
|
|
|
|
|
|
|
class TexturePVRNPOT8888 : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
virtual void onEnter();
|
|
|
|
};
|
|
|
|
|
|
|
|
class TextureAlias : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
virtual void onEnter();
|
|
|
|
};
|
|
|
|
|
|
|
|
class TexturePixelFormat : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
virtual void onEnter();
|
|
|
|
};
|
|
|
|
|
|
|
|
class TextureBlend : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
virtual void onEnter();
|
|
|
|
};
|
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
class TextureAsync : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual ~TextureAsync();
|
2012-06-08 13:55:28 +08:00
|
|
|
void loadImages(float dt);
|
2012-04-19 14:35:52 +08:00
|
|
|
void imageLoaded(CCObject* pObj);
|
2012-03-23 18:16:47 +08:00
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
2012-04-19 14:35:52 +08:00
|
|
|
virtual void onEnter();
|
|
|
|
private:
|
2013-06-15 14:03:30 +08:00
|
|
|
int _imageOffset;
|
2012-03-23 18:16:47 +08:00
|
|
|
};
|
|
|
|
|
2011-07-20 15:35:20 +08:00
|
|
|
class TextureGlRepeat : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual ~TextureGlRepeat();
|
|
|
|
virtual std::string title();
|
|
|
|
|
|
|
|
virtual void onEnter();
|
|
|
|
};
|
|
|
|
|
|
|
|
class TextureGlClamp : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual ~TextureGlClamp();
|
|
|
|
virtual std::string title();
|
|
|
|
|
|
|
|
virtual void onEnter();
|
|
|
|
};
|
|
|
|
|
|
|
|
class TextureSizeTest : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
virtual void onEnter();
|
|
|
|
};
|
|
|
|
|
|
|
|
class TextureCache1 : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
virtual void onEnter();
|
|
|
|
};
|
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
class TextureDrawAtPoint : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
~TextureDrawAtPoint();
|
2012-03-26 16:46:23 +08:00
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
2012-04-19 14:35:52 +08:00
|
|
|
virtual void onEnter();
|
|
|
|
virtual void draw();
|
|
|
|
private:
|
2013-06-15 14:03:30 +08:00
|
|
|
CCTexture2D* _tex1, *_tex2;
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TextureDrawInRect : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
~TextureDrawInRect();
|
2012-03-26 16:46:23 +08:00
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
2012-04-19 14:35:52 +08:00
|
|
|
virtual void onEnter();
|
|
|
|
virtual void draw();
|
|
|
|
private:
|
2013-06-15 14:03:30 +08:00
|
|
|
CCTexture2D* _tex1, *_tex2;
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
2012-03-26 16:46:23 +08:00
|
|
|
|
2011-07-20 15:35:20 +08:00
|
|
|
class TextureTestScene : public TestScene
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void runThisTest();
|
|
|
|
};
|
|
|
|
|
2012-06-13 10:41:04 +08:00
|
|
|
class TextureMemoryAlloc : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void onEnter();
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
void updateImage(CCObject *sender);
|
|
|
|
void changeBackgroundVisible(CCObject *sender);
|
|
|
|
private:
|
2013-06-15 14:03:30 +08:00
|
|
|
CCSprite *_background;
|
2012-06-13 10:41:04 +08:00
|
|
|
};
|
|
|
|
|
2013-02-28 14:54:09 +08:00
|
|
|
class TexturePVRv3Premult : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
TexturePVRv3Premult();
|
|
|
|
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
|
|
|
|
void transformSprite(cocos2d::CCSprite *sprite);
|
|
|
|
};
|
|
|
|
|
2013-05-27 14:42:22 +08:00
|
|
|
// ETC1 texture format test
|
|
|
|
class TextureETC1 : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
TextureETC1();
|
|
|
|
|
|
|
|
virtual std::string title();
|
|
|
|
virtual std::string subtitle();
|
|
|
|
};
|
|
|
|
|
2011-07-20 15:35:20 +08:00
|
|
|
#endif // __TEXTURE2D_TEST_H__
|