2233 auto s = Director::getInstance()->getWinSize();
2235 auto background = LayerColor::create(Color4B(255,0,0,255), s.width, s.height);
2236 addChild(background, -1);
2238 const char* img =
"Images/test_image_rgba8888.png";
2239 addImageToDemo(*
this, 1*s.width/9, s.height/2+32, img, backend::PixelFormat::RGBA8888);
2240 addImageToDemo(*
this, 2*s.width/9, s.height/2-32, img, backend::PixelFormat::RGB888);
2241 addImageToDemo(*
this, 3*s.width/9, s.height/2+32, img, backend::PixelFormat::RGB565);
2242 addImageToDemo(*
this, 4*s.width/9, s.height/2-32, img, backend::PixelFormat::A8);
2243 addImageToDemo(*
this, 5*s.width/9, s.height/2+32, img, backend::PixelFormat::I8);
2244 addImageToDemo(*
this, 6*s.width/9, s.height/2-32, img, backend::PixelFormat::AI88);
2245 addImageToDemo(*
this, 7*s.width/9, s.height/2+32, img, backend::PixelFormat::RGBA4444);
2246 addImageToDemo(*
this, 8*s.width/9, s.height/2-32, img, backend::PixelFormat::RGB5A1);
2249 Texture2D::setDefaultAlphaPixelFormat(backend::PixelFormat::DEFAULT);
2250 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