2012-04-19 14:35:52 +08:00
|
|
|
#include "PerformanceTextureTest.h"
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
TEST_COUNT = 1,
|
|
|
|
};
|
|
|
|
|
|
|
|
static int s_nTexCurCase = 0;
|
|
|
|
|
2011-03-25 13:59:08 +08:00
|
|
|
float calculateDeltaTime( struct timeval *lastUpdate )
|
|
|
|
{
|
|
|
|
struct timeval now;
|
|
|
|
|
|
|
|
gettimeofday( &now, NULL);
|
|
|
|
|
|
|
|
float dt = (now.tv_sec - lastUpdate->tv_sec) + (now.tv_usec - lastUpdate->tv_usec) / 1000000.0f;
|
|
|
|
|
|
|
|
return dt;
|
2012-04-19 14:35:52 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// TextureMenuLayer
|
|
|
|
//
|
|
|
|
////////////////////////////////////////////////////////
|
|
|
|
void TextureMenuLayer::showCurrentTest()
|
|
|
|
{
|
2013-07-23 08:25:44 +08:00
|
|
|
Scene* scene = NULL;
|
2012-04-19 14:35:52 +08:00
|
|
|
|
2013-06-15 14:03:30 +08:00
|
|
|
switch (_curCase)
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
|
|
|
case 0:
|
2013-07-23 08:25:44 +08:00
|
|
|
scene = TextureTest::scene();
|
2012-04-19 14:35:52 +08:00
|
|
|
break;
|
|
|
|
}
|
2013-06-15 14:03:30 +08:00
|
|
|
s_nTexCurCase = _curCase;
|
2012-04-19 14:35:52 +08:00
|
|
|
|
2013-07-23 08:25:44 +08:00
|
|
|
if (scene)
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
2013-07-23 08:25:44 +08:00
|
|
|
Director::getInstance()->replaceScene(scene);
|
2012-04-19 14:35:52 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void TextureMenuLayer::onEnter()
|
|
|
|
{
|
|
|
|
PerformBasicLayer::onEnter();
|
|
|
|
|
2013-08-16 16:05:27 +08:00
|
|
|
auto s = Director::getInstance()->getWinSize();
|
2011-03-25 13:59:08 +08:00
|
|
|
|
|
|
|
// Title
|
2013-08-16 16:05:27 +08:00
|
|
|
auto label = LabelTTF::create(title().c_str(), "Arial", 40);
|
2011-03-25 13:59:08 +08:00
|
|
|
addChild(label, 1);
|
2013-07-12 14:11:55 +08:00
|
|
|
label->setPosition(Point(s.width/2, s.height-32));
|
2013-07-05 16:49:22 +08:00
|
|
|
label->setColor(Color3B(255,255,40));
|
2011-03-25 13:59:08 +08:00
|
|
|
|
|
|
|
// Subtitle
|
|
|
|
std::string strSubTitle = subtitle();
|
|
|
|
if(strSubTitle.length())
|
|
|
|
{
|
2013-08-16 16:05:27 +08:00
|
|
|
auto l = LabelTTF::create(strSubTitle.c_str(), "Thonburi", 16);
|
2011-03-25 13:59:08 +08:00
|
|
|
addChild(l, 1);
|
2013-07-12 14:11:55 +08:00
|
|
|
l->setPosition(Point(s.width/2, s.height-80));
|
2012-04-19 14:35:52 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
performTests();
|
|
|
|
}
|
|
|
|
|
2013-12-19 05:52:10 +08:00
|
|
|
std::string TextureMenuLayer::title() const
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
|
|
|
return "no title";
|
|
|
|
}
|
|
|
|
|
2013-12-19 05:52:10 +08:00
|
|
|
std::string TextureMenuLayer::subtitle() const
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
|
|
|
return "no subtitle";
|
|
|
|
}
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// TextureTest
|
|
|
|
//
|
|
|
|
////////////////////////////////////////////////////////
|
2011-03-25 13:59:08 +08:00
|
|
|
void TextureTest::performTestsPNG(const char* filename)
|
|
|
|
{
|
|
|
|
struct timeval now;
|
2013-06-20 14:17:10 +08:00
|
|
|
Texture2D *texture;
|
2013-11-07 21:48:39 +08:00
|
|
|
auto cache = Director::getInstance()->getTextureCache();
|
2014-01-24 16:53:59 +08:00
|
|
|
|
|
|
|
Texture2D::PixelFormat defaultFormat = Texture2D::getDefaultAlphaPixelFormat();
|
2011-03-25 13:59:08 +08:00
|
|
|
|
2013-07-24 06:20:22 +08:00
|
|
|
log("RGBA 8888");
|
2013-07-26 04:36:19 +08:00
|
|
|
Texture2D::setDefaultAlphaPixelFormat(Texture2D::PixelFormat::RGBA8888);
|
2011-03-25 13:59:08 +08:00
|
|
|
gettimeofday(&now, NULL);
|
|
|
|
texture = cache->addImage(filename);
|
|
|
|
if( texture )
|
2013-07-24 06:20:22 +08:00
|
|
|
log(" ms:%f", calculateDeltaTime(&now) );
|
2011-03-25 13:59:08 +08:00
|
|
|
else
|
2013-07-24 06:20:22 +08:00
|
|
|
log(" ERROR");
|
2011-03-25 13:59:08 +08:00
|
|
|
cache->removeTexture(texture);
|
|
|
|
|
2013-07-24 06:20:22 +08:00
|
|
|
log("RGBA 4444");
|
2013-07-26 04:36:19 +08:00
|
|
|
Texture2D::setDefaultAlphaPixelFormat(Texture2D::PixelFormat::RGBA4444);
|
2011-03-25 13:59:08 +08:00
|
|
|
gettimeofday(&now, NULL);
|
|
|
|
texture = cache->addImage(filename);
|
|
|
|
if( texture )
|
2013-07-24 06:20:22 +08:00
|
|
|
log(" ms:%f", calculateDeltaTime(&now) );
|
2011-03-25 13:59:08 +08:00
|
|
|
else
|
2013-07-24 06:20:22 +08:00
|
|
|
log(" ERROR");
|
2011-03-25 13:59:08 +08:00
|
|
|
cache->removeTexture(texture);
|
|
|
|
|
2013-07-24 06:20:22 +08:00
|
|
|
log("RGBA 5551");
|
2013-07-26 04:36:19 +08:00
|
|
|
Texture2D::setDefaultAlphaPixelFormat(Texture2D::PixelFormat::RGB5A1);
|
2011-03-25 13:59:08 +08:00
|
|
|
gettimeofday(&now, NULL);
|
|
|
|
texture = cache->addImage(filename);
|
|
|
|
if( texture )
|
2013-07-24 06:20:22 +08:00
|
|
|
log(" ms:%f", calculateDeltaTime(&now) );
|
2011-03-25 13:59:08 +08:00
|
|
|
else
|
2013-07-24 06:20:22 +08:00
|
|
|
log(" ERROR");
|
2011-03-25 13:59:08 +08:00
|
|
|
cache->removeTexture(texture);
|
|
|
|
|
2013-07-24 06:20:22 +08:00
|
|
|
log("RGB 565");
|
2013-07-26 04:36:19 +08:00
|
|
|
Texture2D::setDefaultAlphaPixelFormat(Texture2D::PixelFormat::RGB565);
|
2012-04-19 14:35:52 +08:00
|
|
|
gettimeofday(&now, NULL);
|
2011-03-25 13:59:08 +08:00
|
|
|
texture = cache->addImage(filename);
|
|
|
|
if( texture )
|
2013-07-24 06:20:22 +08:00
|
|
|
log(" ms:%f", calculateDeltaTime(&now) );
|
2011-03-25 13:59:08 +08:00
|
|
|
else
|
2013-07-24 06:20:22 +08:00
|
|
|
log(" ERROR");
|
2011-03-25 13:59:08 +08:00
|
|
|
cache->removeTexture(texture);
|
2014-01-24 16:53:59 +08:00
|
|
|
|
|
|
|
Texture2D::setDefaultAlphaPixelFormat(defaultFormat);
|
2011-03-25 13:59:08 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void TextureTest::performTests()
|
|
|
|
{
|
2013-06-20 14:17:10 +08:00
|
|
|
// Texture2D *texture;
|
2012-04-19 14:35:52 +08:00
|
|
|
// struct timeval now;
|
2013-11-07 21:48:39 +08:00
|
|
|
// auto cache = Director::getInstance()->getTextureCache();
|
2011-03-25 13:59:08 +08:00
|
|
|
|
2013-07-24 06:20:22 +08:00
|
|
|
log("--------");
|
2011-03-25 13:59:08 +08:00
|
|
|
|
2013-07-24 06:20:22 +08:00
|
|
|
log("--- PNG 128x128 ---");
|
2011-03-25 13:59:08 +08:00
|
|
|
performTestsPNG("Images/test_image.png");
|
|
|
|
|
2013-07-24 06:20:22 +08:00
|
|
|
// log("--- PVR 128x128 ---");
|
|
|
|
// log("RGBA 8888");
|
2012-04-19 14:35:52 +08:00
|
|
|
// gettimeofday(&now, NULL);
|
|
|
|
// texture = cache->addImage("Images/test_image_rgba8888.pvr");
|
|
|
|
// if( texture )
|
2013-07-24 06:20:22 +08:00
|
|
|
// log(" ms:%f", calculateDeltaTime(&now) );
|
2012-04-19 14:35:52 +08:00
|
|
|
// else
|
2013-07-24 06:20:22 +08:00
|
|
|
// log("ERROR");
|
2012-04-19 14:35:52 +08:00
|
|
|
// cache->removeTexture(texture);
|
|
|
|
//
|
2013-07-24 06:20:22 +08:00
|
|
|
// log("BGRA 8888");
|
2012-04-19 14:35:52 +08:00
|
|
|
// gettimeofday(&now, NULL);
|
|
|
|
// texture = cache->addImage("Images/test_image_bgra8888.pvr");
|
|
|
|
// if( texture )
|
2013-07-24 06:20:22 +08:00
|
|
|
// log(" ms:%f", calculateDeltaTime(&now) );
|
2012-04-19 14:35:52 +08:00
|
|
|
// else
|
2013-07-24 06:20:22 +08:00
|
|
|
// log("ERROR");
|
2012-04-19 14:35:52 +08:00
|
|
|
// cache->removeTexture(texture);
|
|
|
|
//
|
2013-07-24 06:20:22 +08:00
|
|
|
// log("RGBA 4444");
|
2012-04-19 14:35:52 +08:00
|
|
|
// gettimeofday(&now, NULL);
|
|
|
|
// texture = cache->addImage("Images/test_image_rgba4444.pvr");
|
|
|
|
// if( texture )
|
2013-07-24 06:20:22 +08:00
|
|
|
// log(" ms:%f", calculateDeltaTime(&now) );
|
2012-04-19 14:35:52 +08:00
|
|
|
// else
|
2013-07-24 06:20:22 +08:00
|
|
|
// log("ERROR");
|
2012-04-19 14:35:52 +08:00
|
|
|
// cache->removeTexture(texture);
|
|
|
|
//
|
2013-07-24 06:20:22 +08:00
|
|
|
// log("RGB 565");
|
2012-04-19 14:35:52 +08:00
|
|
|
// gettimeofday(&now, NULL);
|
|
|
|
// texture = cache->addImage("Images/test_image_rgb565.pvr");
|
|
|
|
// if( texture )
|
2013-07-24 06:20:22 +08:00
|
|
|
// log(" ms:%f", calculateDeltaTime(&now) );
|
2012-04-19 14:35:52 +08:00
|
|
|
// else
|
2013-07-24 06:20:22 +08:00
|
|
|
// log("ERROR");
|
2012-04-19 14:35:52 +08:00
|
|
|
// cache->removeTexture(texture);
|
2011-03-25 13:59:08 +08:00
|
|
|
|
|
|
|
|
2013-07-24 06:20:22 +08:00
|
|
|
log("--- PNG 512x512 ---");
|
2011-03-25 13:59:08 +08:00
|
|
|
performTestsPNG("Images/texture512x512.png");
|
|
|
|
|
2013-07-24 06:20:22 +08:00
|
|
|
// log("--- PVR 512x512 ---");
|
|
|
|
// log("RGBA 4444");
|
2012-04-19 14:35:52 +08:00
|
|
|
// gettimeofday(&now, NULL);
|
|
|
|
// texture = cache->addImage("Images/texture512x512_rgba4444.pvr");
|
|
|
|
// if( texture )
|
2013-07-24 06:20:22 +08:00
|
|
|
// log(" ms:%f", calculateDeltaTime(&now) );
|
2012-04-19 14:35:52 +08:00
|
|
|
// else
|
2013-07-24 06:20:22 +08:00
|
|
|
// log("ERROR");
|
2012-04-19 14:35:52 +08:00
|
|
|
// cache->removeTexture(texture);
|
2011-03-25 13:59:08 +08:00
|
|
|
|
|
|
|
//
|
|
|
|
// ---- 1024X1024
|
|
|
|
// RGBA4444
|
|
|
|
// Empty image
|
|
|
|
//
|
|
|
|
|
2013-07-24 06:20:22 +08:00
|
|
|
log("EMPTY IMAGE");
|
|
|
|
log("--- PNG 1024x1024 ---");
|
2011-03-25 13:59:08 +08:00
|
|
|
performTestsPNG("Images/texture1024x1024.png");
|
|
|
|
|
2013-07-24 06:20:22 +08:00
|
|
|
// log("--- PVR 1024x1024 ---");
|
|
|
|
// log("RGBA 4444");
|
2012-04-19 14:35:52 +08:00
|
|
|
// gettimeofday(&now, NULL);
|
|
|
|
// texture = cache->addImage("Images/texture1024x1024_rgba4444.pvr");
|
|
|
|
// if( texture )
|
2013-07-24 06:20:22 +08:00
|
|
|
// log(" ms:%f", calculateDeltaTime(&now) );
|
2012-04-19 14:35:52 +08:00
|
|
|
// else
|
2013-07-24 06:20:22 +08:00
|
|
|
// log("ERROR");
|
2012-04-19 14:35:52 +08:00
|
|
|
// cache->removeTexture(texture);
|
|
|
|
//
|
2013-07-24 06:20:22 +08:00
|
|
|
// log("--- PVR.GZ 1024x1024 ---");
|
|
|
|
// log("RGBA 4444");
|
2012-04-19 14:35:52 +08:00
|
|
|
// gettimeofday(&now, NULL);
|
|
|
|
// texture = cache->addImage("Images/texture1024x1024_rgba4444.pvr.gz");
|
|
|
|
// if( texture )
|
2013-07-24 06:20:22 +08:00
|
|
|
// log(" ms:%f", calculateDeltaTime(&now) );
|
2012-04-19 14:35:52 +08:00
|
|
|
// else
|
2013-07-24 06:20:22 +08:00
|
|
|
// log("ERROR");
|
2012-04-19 14:35:52 +08:00
|
|
|
// cache->removeTexture(texture);
|
|
|
|
//
|
2013-07-24 06:20:22 +08:00
|
|
|
// log("--- PVR.CCZ 1024x1024 ---");
|
|
|
|
// log("RGBA 4444");
|
2012-04-19 14:35:52 +08:00
|
|
|
// gettimeofday(&now, NULL);
|
|
|
|
// texture = cache->addImage("Images/texture1024x1024_rgba4444.pvr.ccz");
|
|
|
|
// if( texture )
|
2013-07-24 06:20:22 +08:00
|
|
|
// log(" ms:%f", calculateDeltaTime(&now) );
|
2012-04-19 14:35:52 +08:00
|
|
|
// else
|
2013-07-24 06:20:22 +08:00
|
|
|
// log("ERROR");
|
2012-04-19 14:35:52 +08:00
|
|
|
// cache->removeTexture(texture);
|
2011-03-25 13:59:08 +08:00
|
|
|
|
|
|
|
//
|
|
|
|
// ---- 1024X1024
|
|
|
|
// RGBA4444
|
|
|
|
// SpriteSheet images
|
|
|
|
//
|
|
|
|
|
2013-07-24 06:20:22 +08:00
|
|
|
log("SPRITESHEET IMAGE");
|
|
|
|
log("--- PNG 1024x1024 ---");
|
2011-03-25 13:59:08 +08:00
|
|
|
performTestsPNG("Images/PlanetCute-1024x1024.png");
|
|
|
|
|
2013-07-24 06:20:22 +08:00
|
|
|
// log("--- PVR 1024x1024 ---");
|
|
|
|
// log("RGBA 4444");
|
2012-04-19 14:35:52 +08:00
|
|
|
// gettimeofday(&now, NULL);
|
|
|
|
// texture = cache->addImage("Images/PlanetCute-1024x1024-rgba4444.pvr");
|
|
|
|
// if( texture )
|
2013-07-24 06:20:22 +08:00
|
|
|
// log(" ms:%f", calculateDeltaTime(&now) );
|
2012-04-19 14:35:52 +08:00
|
|
|
// else
|
2013-07-24 06:20:22 +08:00
|
|
|
// log("ERROR");
|
2012-04-19 14:35:52 +08:00
|
|
|
// cache->removeTexture(texture);
|
|
|
|
//
|
2013-07-24 06:20:22 +08:00
|
|
|
// log("--- PVR.GZ 1024x1024 ---");
|
|
|
|
// log("RGBA 4444");
|
2012-04-19 14:35:52 +08:00
|
|
|
// gettimeofday(&now, NULL);
|
|
|
|
// texture = cache->addImage("Images/PlanetCute-1024x1024-rgba4444.pvr.gz");
|
|
|
|
// if( texture )
|
2013-07-24 06:20:22 +08:00
|
|
|
// log(" ms:%f", calculateDeltaTime(&now) );
|
2012-04-19 14:35:52 +08:00
|
|
|
// else
|
2013-07-24 06:20:22 +08:00
|
|
|
// log("ERROR");
|
2012-04-19 14:35:52 +08:00
|
|
|
// cache->removeTexture(texture);
|
|
|
|
//
|
2013-07-24 06:20:22 +08:00
|
|
|
// log("--- PVR.CCZ 1024x1024 ---");
|
|
|
|
// log("RGBA 4444");
|
2012-04-19 14:35:52 +08:00
|
|
|
// gettimeofday(&now, NULL);
|
|
|
|
// texture = cache->addImage("Images/PlanetCute-1024x1024-rgba4444.pvr.ccz");
|
|
|
|
// if( texture )
|
2013-07-24 06:20:22 +08:00
|
|
|
// log(" ms:%f", calculateDeltaTime(&now) );
|
2012-04-19 14:35:52 +08:00
|
|
|
// else
|
2013-07-24 06:20:22 +08:00
|
|
|
// log("ERROR");
|
2012-04-19 14:35:52 +08:00
|
|
|
// cache->removeTexture(texture);
|
2011-03-25 13:59:08 +08:00
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
// ---- 1024X1024
|
|
|
|
// RGBA8888
|
|
|
|
// Landscape Image
|
|
|
|
//
|
|
|
|
|
2013-07-24 06:20:22 +08:00
|
|
|
log("LANDSCAPE IMAGE");
|
2011-03-25 13:59:08 +08:00
|
|
|
|
2013-07-24 06:20:22 +08:00
|
|
|
log("--- PNG 1024x1024 ---");
|
2011-03-25 13:59:08 +08:00
|
|
|
performTestsPNG("Images/landscape-1024x1024.png");
|
|
|
|
|
2013-07-24 06:20:22 +08:00
|
|
|
// log("--- PVR 1024x1024 ---");
|
|
|
|
// log("RGBA 8888");
|
2012-04-19 14:35:52 +08:00
|
|
|
// gettimeofday(&now, NULL);
|
|
|
|
// texture = cache->addImage("Images/landscape-1024x1024-rgba8888.pvr");
|
|
|
|
// if( texture )
|
2013-07-24 06:20:22 +08:00
|
|
|
// log(" ms:%f", calculateDeltaTime(&now) );
|
2012-04-19 14:35:52 +08:00
|
|
|
// else
|
2013-07-24 06:20:22 +08:00
|
|
|
// log("ERROR");
|
2012-04-19 14:35:52 +08:00
|
|
|
// cache->removeTexture(texture);
|
|
|
|
//
|
2013-07-24 06:20:22 +08:00
|
|
|
// log("--- PVR.GZ 1024x1024 ---");
|
|
|
|
// log("RGBA 8888");
|
2012-04-19 14:35:52 +08:00
|
|
|
// gettimeofday(&now, NULL);
|
|
|
|
// texture = cache->addImage("Images/landscape-1024x1024-rgba8888.pvr.gz");
|
|
|
|
// if( texture )
|
2013-07-24 06:20:22 +08:00
|
|
|
// log(" ms:%f", calculateDeltaTime(&now) );
|
2012-04-19 14:35:52 +08:00
|
|
|
// else
|
2013-07-24 06:20:22 +08:00
|
|
|
// log("ERROR");
|
2012-04-19 14:35:52 +08:00
|
|
|
// cache->removeTexture(texture);
|
|
|
|
//
|
2013-07-24 06:20:22 +08:00
|
|
|
// log("--- PVR.CCZ 1024x1024 ---");
|
|
|
|
// log("RGBA 8888");
|
2012-04-19 14:35:52 +08:00
|
|
|
// gettimeofday(&now, NULL);
|
|
|
|
// texture = cache->addImage("Images/landscape-1024x1024-rgba8888.pvr.ccz");
|
|
|
|
// if( texture )
|
2013-07-24 06:20:22 +08:00
|
|
|
// log(" ms:%f", calculateDeltaTime(&now) );
|
2012-04-19 14:35:52 +08:00
|
|
|
// else
|
2013-07-24 06:20:22 +08:00
|
|
|
// log("ERROR");
|
2012-04-19 14:35:52 +08:00
|
|
|
// cache->removeTexture(texture);
|
2011-03-25 13:59:08 +08:00
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
// 2048x2048
|
|
|
|
// RGBA444
|
|
|
|
//
|
|
|
|
|
2011-04-07 14:30:35 +08:00
|
|
|
// most platform don't support texture with width/height is 2048
|
2013-07-24 06:20:22 +08:00
|
|
|
// log("--- PNG 2048x2048 ---");
|
2012-04-19 14:35:52 +08:00
|
|
|
// performTestsPNG("Images/texture2048x2048.png");
|
|
|
|
|
2013-07-24 06:20:22 +08:00
|
|
|
// log("--- PVR 2048x2048 ---");
|
|
|
|
// log("RGBA 4444");
|
2012-04-19 14:35:52 +08:00
|
|
|
// gettimeofday(&now, NULL);
|
|
|
|
// texture = cache->addImage("Images/texture2048x2048_rgba4444.pvr");
|
|
|
|
// if( texture )
|
2013-07-24 06:20:22 +08:00
|
|
|
// log(" ms:%f", calculateDeltaTime(&now) );
|
2012-04-19 14:35:52 +08:00
|
|
|
// else
|
2013-07-24 06:20:22 +08:00
|
|
|
// log("ERROR");
|
2012-04-19 14:35:52 +08:00
|
|
|
// cache->removeTexture(texture);
|
2011-03-25 13:59:08 +08:00
|
|
|
}
|
|
|
|
|
2013-12-19 05:52:10 +08:00
|
|
|
std::string TextureTest::title() const
|
2011-03-25 13:59:08 +08:00
|
|
|
{
|
|
|
|
return "Texture Performance Test";
|
|
|
|
}
|
|
|
|
|
2013-12-19 05:52:10 +08:00
|
|
|
std::string TextureTest::subtitle() const
|
2011-03-25 13:59:08 +08:00
|
|
|
{
|
|
|
|
return "See console for results";
|
2012-04-19 14:35:52 +08:00
|
|
|
}
|
|
|
|
|
2013-06-20 14:17:10 +08:00
|
|
|
Scene* TextureTest::scene()
|
2012-04-19 14:35:52 +08:00
|
|
|
{
|
2013-08-16 16:05:27 +08:00
|
|
|
auto scene = Scene::create();
|
2011-03-25 13:59:08 +08:00
|
|
|
TextureTest *layer = new TextureTest(false, TEST_COUNT, s_nTexCurCase);
|
2013-07-23 08:25:44 +08:00
|
|
|
scene->addChild(layer);
|
2011-03-25 13:59:08 +08:00
|
|
|
layer->release();
|
|
|
|
|
2013-07-23 08:25:44 +08:00
|
|
|
return scene;
|
2012-04-19 14:35:52 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void runTextureTest()
|
|
|
|
{
|
|
|
|
s_nTexCurCase = 0;
|
2013-08-16 16:05:27 +08:00
|
|
|
auto scene = TextureTest::scene();
|
2013-07-23 08:25:44 +08:00
|
|
|
Director::getInstance()->replaceScene(scene);
|
2012-04-19 14:35:52 +08:00
|
|
|
}
|