2267 auto s = Director::getInstance()->getWinSize();
2269 auto background = LayerColor::create(Color4B(255,0,0,255), s.width, s.height);
2270 addChild(background, -1);
2272 const char* img =
"Images/test_image_i8.png";
2273 addImageToDemo(*
this, 1*s.width/9, s.height/2+32, img, backend::PixelFormat::RGBA8888);
2274 addImageToDemo(*
this, 2*s.width/9, s.height/2-32, img, backend::PixelFormat::RGB888);
2275 addImageToDemo(*
this, 3*s.width/9, s.height/2+32, img, backend::PixelFormat::RGB565);
2276 addImageToDemo(*
this, 4*s.width/9, s.height/2-32, img, backend::PixelFormat::A8);
2277 addImageToDemo(*
this, 5*s.width/9, s.height/2+32, img, backend::PixelFormat::I8);
2278 addImageToDemo(*
this, 6*s.width/9, s.height/2-32, img, backend::PixelFormat::AI88);
2279 addImageToDemo(*
this, 7*s.width/9, s.height/2+32, img, backend::PixelFormat::RGBA4444);
2280 addImageToDemo(*
this, 8*s.width/9, s.height/2-32, img, backend::PixelFormat::RGB5A1);
2283 Texture2D::setDefaultAlphaPixelFormat(backend::PixelFormat::DEFAULT);
2284 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