2014-01-14 06:48:12 +08:00
|
|
|
/****************************************************************************
|
|
|
|
Copyright (c) 2012 cocos2d-x.org
|
2018-01-29 16:25:32 +08:00
|
|
|
Copyright (c) 2013-2016 Chukong Technologies Inc.
|
|
|
|
Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
|
2014-01-14 06:48:12 +08:00
|
|
|
|
|
|
|
http://www.cocos2d-x.org
|
|
|
|
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
of this software and associated documentation files (the "Software"), to deal
|
|
|
|
in the Software without restriction, including without limitation the rights
|
|
|
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
copies of the Software, and to permit persons to whom the Software is
|
|
|
|
furnished to do so, subject to the following conditions:
|
|
|
|
|
|
|
|
The above copyright notice and this permission notice shall be included in
|
|
|
|
all copies or substantial portions of the Software.
|
|
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
|
THE SOFTWARE.
|
|
|
|
****************************************************************************/
|
|
|
|
|
2011-07-20 15:35:20 +08:00
|
|
|
#ifndef __TEXTURE2D_TEST_H__
|
|
|
|
#define __TEXTURE2D_TEST_H__
|
|
|
|
|
2013-06-07 08:12:28 +08:00
|
|
|
#include "../BaseTest.h"
|
2011-07-20 15:35:20 +08:00
|
|
|
|
2015-04-03 14:31:03 +08:00
|
|
|
DEFINE_TEST_SUITE(Texture2DTests);
|
2012-03-26 16:46:23 +08:00
|
|
|
|
2015-04-03 14:31:03 +08:00
|
|
|
class TextureDemo : public TestCase
|
2011-07-20 15:35:20 +08:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual ~TextureDemo();
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
2011-07-20 15:35:20 +08:00
|
|
|
};
|
|
|
|
|
2012-05-25 10:58:28 +08:00
|
|
|
class TextureTIFF : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:47:26 +08:00
|
|
|
CREATE_FUNC(TextureTIFF);
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
2012-05-25 10:58:28 +08:00
|
|
|
};
|
|
|
|
|
2013-11-29 14:31:42 +08:00
|
|
|
|
|
|
|
class TextureTGA : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(TextureTGA);
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
2013-11-29 14:31:42 +08:00
|
|
|
};
|
|
|
|
|
2011-07-20 15:35:20 +08:00
|
|
|
class TexturePNG : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:47:26 +08:00
|
|
|
CREATE_FUNC(TexturePNG);
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2014-06-05 16:33:42 +08:00
|
|
|
virtual std::string subtitle() const override;
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
2011-07-20 15:35:20 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TextureJPEG : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:47:26 +08:00
|
|
|
CREATE_FUNC(TextureJPEG);
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
2013-02-05 11:37:13 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TextureWEBP : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:47:26 +08:00
|
|
|
CREATE_FUNC(TextureWEBP);
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
2011-07-20 15:35:20 +08:00
|
|
|
};
|
|
|
|
|
2015-12-20 19:22:04 +08:00
|
|
|
class TextureWEBPNoAlpha : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(TextureWEBPNoAlpha);
|
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual void onEnter() override;
|
|
|
|
};
|
|
|
|
|
2011-07-20 15:35:20 +08:00
|
|
|
class TextureMipMap : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:47:26 +08:00
|
|
|
CREATE_FUNC(TextureMipMap);
|
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;
|
2011-07-20 15:35:20 +08:00
|
|
|
};
|
|
|
|
|
2013-06-20 13:43:40 +08:00
|
|
|
class TexturePVRTest : public TextureDemo
|
2011-07-20 15:35:20 +08:00
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:47:26 +08:00
|
|
|
CREATE_FUNC(TexturePVRTest);
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
2011-07-20 15:35:20 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TexturePVR2BPP : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:47:26 +08:00
|
|
|
CREATE_FUNC(TexturePVR2BPP);
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
2011-07-20 15:35:20 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TexturePVR4BPP : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:47:26 +08:00
|
|
|
CREATE_FUNC(TexturePVR4BPP);
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
2011-07-20 15:35:20 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TexturePVRRGBA8888 : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:47:26 +08:00
|
|
|
CREATE_FUNC(TexturePVRRGBA8888);
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
2011-07-20 15:35:20 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TexturePVRBGRA8888 : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:47:26 +08:00
|
|
|
CREATE_FUNC(TexturePVRBGRA8888);
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
2011-07-20 15:35:20 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TexturePVRRGBA4444 : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:47:26 +08:00
|
|
|
CREATE_FUNC(TexturePVRRGBA4444);
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
2011-07-20 15:35:20 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TexturePVRRGBA4444GZ : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:47:26 +08:00
|
|
|
CREATE_FUNC(TexturePVRRGBA4444GZ);
|
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;
|
2011-07-20 15:35:20 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TexturePVRRGBA4444CCZ : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:47:26 +08:00
|
|
|
CREATE_FUNC(TexturePVRRGBA4444CCZ);
|
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;
|
2011-07-20 15:35:20 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TexturePVRRGBA5551 : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:47:26 +08:00
|
|
|
CREATE_FUNC(TexturePVRRGBA5551);
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
2011-07-20 15:35:20 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TexturePVRRGB565 : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:47:26 +08:00
|
|
|
CREATE_FUNC(TexturePVRRGB565);
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
2011-07-20 15:35:20 +08:00
|
|
|
};
|
|
|
|
|
2012-03-23 18:16:47 +08:00
|
|
|
class TexturePVRRGB888 : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:47:26 +08:00
|
|
|
CREATE_FUNC(TexturePVRRGB888);
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
2012-03-23 18:16:47 +08:00
|
|
|
};
|
|
|
|
|
2011-07-20 15:35:20 +08:00
|
|
|
class TexturePVRA8 : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:47:26 +08:00
|
|
|
CREATE_FUNC(TexturePVRA8);
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
2011-07-20 15:35:20 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TexturePVRI8 : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:47:26 +08:00
|
|
|
CREATE_FUNC(TexturePVRI8);
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
2011-07-20 15:35:20 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TexturePVRAI88 : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:47:26 +08:00
|
|
|
CREATE_FUNC(TexturePVRAI88);
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
2011-07-20 15:35:20 +08:00
|
|
|
};
|
|
|
|
|
2012-11-20 10:42:03 +08:00
|
|
|
class TexturePVR2BPPv3 : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:47:26 +08:00
|
|
|
CREATE_FUNC(TexturePVR2BPPv3);
|
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-20 10:42:03 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TexturePVRII2BPPv3 : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:47:26 +08:00
|
|
|
CREATE_FUNC(TexturePVRII2BPPv3);
|
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-20 10:42:03 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TexturePVR4BPPv3 : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:47:26 +08:00
|
|
|
CREATE_FUNC(TexturePVR4BPPv3);
|
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-20 10:42:03 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TexturePVRII4BPPv3 : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:47:26 +08:00
|
|
|
CREATE_FUNC(TexturePVRII4BPPv3);
|
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-20 10:42:03 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TexturePVRRGBA8888v3 : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:47:26 +08:00
|
|
|
CREATE_FUNC(TexturePVRRGBA8888v3);
|
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-20 10:42:03 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TexturePVRBGRA8888v3 : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:47:26 +08:00
|
|
|
CREATE_FUNC(TexturePVRBGRA8888v3);
|
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-20 10:42:03 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TexturePVRRGBA4444v3 : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:47:26 +08:00
|
|
|
CREATE_FUNC(TexturePVRRGBA4444v3);
|
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-20 10:42:03 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TexturePVRRGBA5551v3 : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:47:26 +08:00
|
|
|
CREATE_FUNC(TexturePVRRGBA5551v3);
|
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-20 10:42:03 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TexturePVRRGB565v3 : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:47:26 +08:00
|
|
|
CREATE_FUNC(TexturePVRRGB565v3);
|
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-20 10:42:03 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TexturePVRRGB888v3 : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:47:26 +08:00
|
|
|
CREATE_FUNC(TexturePVRRGB888v3);
|
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-20 10:42:03 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TexturePVRA8v3 : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:47:26 +08:00
|
|
|
CREATE_FUNC(TexturePVRA8v3);
|
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-20 10:42:03 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TexturePVRI8v3 : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:47:26 +08:00
|
|
|
CREATE_FUNC(TexturePVRI8v3);
|
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-20 10:42:03 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TexturePVRAI88v3 : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:47:26 +08:00
|
|
|
CREATE_FUNC(TexturePVRAI88v3);
|
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-20 10:42:03 +08:00
|
|
|
};
|
|
|
|
|
2011-07-20 15:35:20 +08:00
|
|
|
class TexturePVRBadEncoding : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:47:26 +08:00
|
|
|
CREATE_FUNC(TexturePVRBadEncoding);
|
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;
|
2011-07-20 15:35:20 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TexturePVRMipMap : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:47:26 +08:00
|
|
|
CREATE_FUNC(TexturePVRMipMap);
|
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;
|
2011-07-20 15:35:20 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TexturePVRMipMap2 : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:47:26 +08:00
|
|
|
CREATE_FUNC(TexturePVRMipMap2);
|
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;
|
2011-07-20 15:35:20 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TexturePVRNonSquare : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:47:26 +08:00
|
|
|
CREATE_FUNC(TexturePVRNonSquare);
|
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;
|
2011-07-20 15:35:20 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TexturePVRNPOT4444 : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:47:26 +08:00
|
|
|
CREATE_FUNC(TexturePVRNPOT4444);
|
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;
|
2011-07-20 15:35:20 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TexturePVRNPOT8888 : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:47:26 +08:00
|
|
|
CREATE_FUNC(TexturePVRNPOT8888);
|
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;
|
2011-07-20 15:35:20 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TextureAlias : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:47:26 +08:00
|
|
|
CREATE_FUNC(TextureAlias);
|
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;
|
2011-07-20 15:35:20 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TexturePixelFormat : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:47:26 +08:00
|
|
|
CREATE_FUNC(TexturePixelFormat);
|
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;
|
2011-07-20 15:35:20 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TextureBlend : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:47:26 +08:00
|
|
|
CREATE_FUNC(TextureBlend);
|
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;
|
2011-07-20 15:35:20 +08:00
|
|
|
};
|
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
class TextureAsync : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:47:26 +08:00
|
|
|
CREATE_FUNC(TextureAsync);
|
2012-04-19 14:35:52 +08:00
|
|
|
virtual ~TextureAsync();
|
2015-04-03 14:31:03 +08:00
|
|
|
|
|
|
|
virtual float getDuration() const override { return 5.0f; }
|
2012-06-08 13:55:28 +08:00
|
|
|
void loadImages(float dt);
|
2014-01-02 17:23:00 +08:00
|
|
|
void imageLoaded(cocos2d::Texture2D* texture);
|
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-04-19 14:35:52 +08:00
|
|
|
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:
|
2013-11-14 09:47:26 +08:00
|
|
|
CREATE_FUNC(TextureGlRepeat);
|
2011-07-20 15:35:20 +08:00
|
|
|
virtual ~TextureGlRepeat();
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2011-07-20 15:35:20 +08:00
|
|
|
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
2011-07-20 15:35:20 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TextureGlClamp : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:47:26 +08:00
|
|
|
CREATE_FUNC(TextureGlClamp);
|
2011-07-20 15:35:20 +08:00
|
|
|
virtual ~TextureGlClamp();
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
2011-07-20 15:35:20 +08:00
|
|
|
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
2011-07-20 15:35:20 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TextureSizeTest : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:47:26 +08:00
|
|
|
CREATE_FUNC(TextureSizeTest);
|
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;
|
2011-07-20 15:35:20 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TextureCache1 : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:47:26 +08:00
|
|
|
CREATE_FUNC(TextureCache1);
|
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;
|
2011-07-20 15:35:20 +08:00
|
|
|
};
|
|
|
|
|
2012-04-19 14:35:52 +08:00
|
|
|
class TextureDrawAtPoint : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:47:26 +08:00
|
|
|
CREATE_FUNC(TextureDrawAtPoint);
|
2012-04-19 14:35:52 +08:00
|
|
|
~TextureDrawAtPoint();
|
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;
|
2015-04-09 08:37:30 +08:00
|
|
|
virtual void draw(cocos2d::Renderer* renderer, const cocos2d::Mat4& transform, uint32_t flags) override;
|
2013-12-26 10:03:45 +08:00
|
|
|
protected:
|
2015-04-09 08:37:30 +08:00
|
|
|
void onDraw(const cocos2d::Mat4& transform, uint32_t flags);
|
2014-03-06 07:49:08 +08:00
|
|
|
|
2015-04-09 08:37:30 +08:00
|
|
|
cocos2d::CustomCommand _renderCmd;
|
|
|
|
cocos2d::Texture2D* _tex1, *_Tex2F;
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class TextureDrawInRect : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:47:26 +08:00
|
|
|
CREATE_FUNC(TextureDrawInRect);
|
2012-04-19 14:35:52 +08:00
|
|
|
~TextureDrawInRect();
|
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;
|
2015-04-09 08:37:30 +08:00
|
|
|
virtual void draw(cocos2d::Renderer* renderer, const cocos2d::Mat4& transform, uint32_t flags) override;
|
2013-12-26 10:24:40 +08:00
|
|
|
protected:
|
2015-04-09 08:37:30 +08:00
|
|
|
void onDraw(const cocos2d::Mat4& transform, uint32_t flags);
|
2014-03-06 07:49:08 +08:00
|
|
|
|
2015-04-09 08:37:30 +08:00
|
|
|
cocos2d::CustomCommand _renderCmd;
|
|
|
|
cocos2d::Texture2D* _tex1, *_Tex2F;
|
2012-04-19 14:35:52 +08:00
|
|
|
};
|
2012-03-26 16:46:23 +08:00
|
|
|
|
2012-06-13 10:41:04 +08:00
|
|
|
class TextureMemoryAlloc : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:47:26 +08:00
|
|
|
CREATE_FUNC(TextureMemoryAlloc);
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2015-04-09 08:37:30 +08:00
|
|
|
void updateImage(cocos2d::Ref* sender);
|
|
|
|
void changeBackgroundVisible(cocos2d::Ref* sender);
|
2012-06-13 10:41:04 +08:00
|
|
|
private:
|
2015-04-09 08:37:30 +08:00
|
|
|
cocos2d::Sprite* _background;
|
2012-06-13 10:41:04 +08:00
|
|
|
};
|
|
|
|
|
2013-02-28 14:54:09 +08:00
|
|
|
class TexturePVRv3Premult : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:47:26 +08:00
|
|
|
CREATE_FUNC(TexturePVRv3Premult);
|
2013-02-28 14:54:09 +08:00
|
|
|
TexturePVRv3Premult();
|
|
|
|
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2013-02-28 14:54:09 +08:00
|
|
|
|
2013-06-20 14:17:10 +08:00
|
|
|
void transformSprite(cocos2d::Sprite *sprite);
|
2013-02-28 14:54:09 +08:00
|
|
|
};
|
|
|
|
|
2013-05-27 14:42:22 +08:00
|
|
|
// ETC1 texture format test
|
|
|
|
class TextureETC1 : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:47:26 +08:00
|
|
|
CREATE_FUNC(TextureETC1);
|
2013-05-27 14:42:22 +08:00
|
|
|
TextureETC1();
|
|
|
|
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2013-05-27 14:42:22 +08:00
|
|
|
};
|
|
|
|
|
2013-08-06 11:19:45 +08:00
|
|
|
// S3TC Dxt1 texture format test
|
|
|
|
class TextureS3TCDxt1 : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:47:26 +08:00
|
|
|
CREATE_FUNC(TextureS3TCDxt1);
|
2013-08-06 11:19:45 +08:00
|
|
|
TextureS3TCDxt1();
|
|
|
|
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2013-08-06 11:19:45 +08:00
|
|
|
};
|
2013-08-16 11:02:44 +08:00
|
|
|
|
2013-08-06 11:19:45 +08:00
|
|
|
// S3TC Dxt3 texture format test
|
|
|
|
class TextureS3TCDxt3 : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:47:26 +08:00
|
|
|
CREATE_FUNC(TextureS3TCDxt3);
|
2013-08-06 11:19:45 +08:00
|
|
|
TextureS3TCDxt3();
|
|
|
|
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2013-08-06 11:19:45 +08:00
|
|
|
};
|
2013-08-16 11:02:44 +08:00
|
|
|
|
2013-08-06 11:19:45 +08:00
|
|
|
// S3TC Dxt5 texture format test
|
|
|
|
class TextureS3TCDxt5 : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:47:26 +08:00
|
|
|
CREATE_FUNC(TextureS3TCDxt5);
|
2013-08-06 11:19:45 +08:00
|
|
|
TextureS3TCDxt5();
|
|
|
|
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2013-08-06 11:19:45 +08:00
|
|
|
};
|
|
|
|
|
2014-02-20 18:27:52 +08:00
|
|
|
|
|
|
|
// S3TC texture with no mipmaps test
|
|
|
|
class TextureS3TCWithNoMipmaps : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CREATE_FUNC(TextureS3TCWithNoMipmaps);
|
|
|
|
TextureS3TCWithNoMipmaps();
|
|
|
|
|
|
|
|
virtual std::string title() const override;
|
|
|
|
};
|
|
|
|
|
2013-08-16 11:02:44 +08:00
|
|
|
// ATITC RGB texture format test
|
|
|
|
class TextureATITCRGB : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:47:26 +08:00
|
|
|
CREATE_FUNC(TextureATITCRGB);
|
2013-08-16 11:02:44 +08:00
|
|
|
TextureATITCRGB();
|
|
|
|
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2013-08-16 11:02:44 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
//ATITC RGBA Explicit texture format test
|
|
|
|
class TextureATITCExplicit : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:47:26 +08:00
|
|
|
CREATE_FUNC(TextureATITCExplicit);
|
2013-08-16 11:02:44 +08:00
|
|
|
TextureATITCExplicit();
|
|
|
|
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2013-08-16 11:02:44 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
//ATITC RGBA Interpolated texture format test
|
|
|
|
class TextureATITCInterpolated : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:47:26 +08:00
|
|
|
CREATE_FUNC(TextureATITCInterpolated);
|
2013-08-16 11:02:44 +08:00
|
|
|
TextureATITCInterpolated();
|
|
|
|
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2013-08-16 11:02:44 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2013-07-29 17:34:33 +08:00
|
|
|
// RGB888 texture convert test
|
|
|
|
class TextureConvertRGB888 : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:47:26 +08:00
|
|
|
CREATE_FUNC(TextureConvertRGB888);
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2013-07-29 17:34:33 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
// RGBA8888 texture convert test
|
|
|
|
class TextureConvertRGBA8888 : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:47:26 +08:00
|
|
|
CREATE_FUNC(TextureConvertRGBA8888);
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2013-07-29 17:34:33 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
// I8 texture convert test
|
|
|
|
class TextureConvertI8 : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:47:26 +08:00
|
|
|
CREATE_FUNC(TextureConvertI8);
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2013-07-29 17:34:33 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
// AI88 texture convert test
|
|
|
|
class TextureConvertAI88 : public TextureDemo
|
|
|
|
{
|
|
|
|
public:
|
2013-11-14 09:47:26 +08:00
|
|
|
CREATE_FUNC(TextureConvertAI88);
|
2014-02-27 21:10:03 +08:00
|
|
|
virtual void onEnter() override;
|
2013-12-19 05:52:10 +08:00
|
|
|
virtual std::string title() const override;
|
|
|
|
virtual std::string subtitle() const override;
|
2013-07-29 17:34:33 +08:00
|
|
|
};
|
|
|
|
|
2011-07-20 15:35:20 +08:00
|
|
|
#endif // __TEXTURE2D_TEST_H__
|