PuzzleSDK
TextureETC1类 参考

#include <Texture2dTest.h>

+ 类 TextureETC1 继承关系图:
+ TextureETC1 的协作图:

Public 成员函数

 CREATE_FUNC (TextureETC1)
 
 TextureETC1 ()
 
virtual std::string title () const override
 
virtual std::string subtitle () const override
 
- Public 成员函数 继承自 TextureDemo
virtual ~TextureDemo ()
 
virtual void onEnter () override
 
- Public 成员函数 继承自 TestCase
 TestCase ()
 
 ~TestCase ()
 
virtual Type getTestType () const
 
virtual float getDuration () const
 
virtual std::string getExpectedOutput () const
 
virtual std::string getActualOutput () const
 
virtual void restartTestCallback (cocos2d::Ref *sender)
 
virtual void nextTestCallback (cocos2d::Ref *sender)
 
virtual void priorTestCallback (cocos2d::Ref *sender)
 
virtual void onBackCallback (cocos2d::Ref *sender)
 
void setTestSuite (TestSuite *testSuite)
 
TestSuitegetTestSuite () const
 
float getRunTime () const
 
void setTestCaseName (const std::string &name)
 
std::string getTestCaseName () const
 
const cocos2d::Label * getSubtitleLable () const
 
const cocos2d::MenuItemImage * getRestartTestItem () const
 

额外继承的成员函数

- Public 类型 继承自 TestCase
enum class  Type { ROBUSTNESS , UNIT , GRAPHICAL_STATIC , MANUAL }
 
- Public 属性 继承自 TestCase
CC_CONSTRUCTOR_ACCESS __pad0__: virtual bool init() override
 
- Protected 属性 继承自 TestCase
cocos2d::MenuItemImage * _priorTestItem
 
cocos2d::MenuItemImage * _restartTestItem
 
cocos2d::MenuItemImage * _nextTestItem
 
cocos2d::Label * _titleLabel
 
cocos2d::Label * _subtitleLabel
 

详细描述

在文件 Texture2dTest.h514 行定义.

构造及析构函数说明

◆ TextureETC1()

TextureETC1::TextureETC1 ( )

在文件 Texture2dTest.cpp2004 行定义.

2005{
2006 auto sprite = Sprite::create("Images/ETC1.pkm");
2007
2008 auto size = Director::getInstance()->getWinSize();
2009 sprite->setPosition(Vec2(size.width/2, size.height/2));
2010
2011 addChild(sprite);
2012}

成员函数说明

◆ CREATE_FUNC()

TextureETC1::CREATE_FUNC ( TextureETC1  )

◆ subtitle()

std::string TextureETC1::subtitle ( ) const
overridevirtual

重载 TestCase .

在文件 Texture2dTest.cpp2019 行定义.

2020{
2021 bool isSupportETCHardwareDecode = Configuration::getInstance()->supportsETC();
2022 Application::Platform platform = Application::getInstance()->getTargetPlatform();
2023 std::string ret;
2024
2025 static std::unordered_map<int, const char*> platformMap = {
2026 {(int)Application::Platform::OS_WINDOWS, "Windows"},
2027 {(int)Application::Platform::OS_LINUX, "Linux"},
2028 {(int)Application::Platform::OS_MAC, "macOS"},
2029 {(int)Application::Platform::OS_ANDROID, "Android"},
2030 {(int)Application::Platform::OS_IPHONE, "iPhone"},
2031 {(int)Application::Platform::OS_IPAD, "iPad"},
2032 };
2033
2034 if (isSupportETCHardwareDecode)
2035 {
2036 ret += "Hardware decode ETC1 on ";
2037
2038 }
2039 else
2040 {
2041 ret += "Software decode ETC1 on ";
2042 }
2043
2044 auto iter = platformMap.find((int)platform);
2045 if (iter != platformMap.end())
2046 {
2047 ret += iter->second;
2048 }
2049 else
2050 {
2051 ret += "Unknown Platform";
2052 }
2053
2054 return ret;
2055}

◆ title()

std::string TextureETC1::title ( ) const
overridevirtual

重载 TestCase .

在文件 Texture2dTest.cpp2014 行定义.

2015{
2016 return "ETC1 texture";
2017}

该类的文档由以下文件生成: