2301 auto s = Director::getInstance()->getWinSize();
2303 auto background = LayerColor::create(Color4B(255,0,0,255), s.width, s.height);
2304 addChild(background, -1);
2306 const char* img =
"Images/test_image_ai88.png";
2307 addImageToDemo(*
this, 1*s.width/9, s.height/2+32, img, backend::PixelFormat::RGBA8888);
2308 addImageToDemo(*
this, 2*s.width/9, s.height/2-32, img, backend::PixelFormat::RGB888);
2309 addImageToDemo(*
this, 3*s.width/9, s.height/2+32, img, backend::PixelFormat::RGB565);
2310 addImageToDemo(*
this, 4*s.width/9, s.height/2-32, img, backend::PixelFormat::A8);
2311 addImageToDemo(*
this, 5*s.width/9, s.height/2+32, img, backend::PixelFormat::I8);
2312 addImageToDemo(*
this, 6*s.width/9, s.height/2-32, img, backend::PixelFormat::AI88);
2313 addImageToDemo(*
this, 7*s.width/9, s.height/2+32, img, backend::PixelFormat::RGBA4444);
2314 addImageToDemo(*
this, 8*s.width/9, s.height/2-32, img, backend::PixelFormat::RGB5A1);
2317 Texture2D::setDefaultAlphaPixelFormat(backend::PixelFormat::DEFAULT);
2318 log(
"%s\n", Director::getInstance()->getTextureCache()->getCachedTextureInfo().c_str());
static void addImageToDemo(TextureDemo &demo, float x, float y, const char *path, backend::PixelFormat format)
virtual void onEnter() override