2199 auto s = Director::getInstance()->getWinSize();
2201 auto background = LayerColor::create(Color4B(255,0,0,255), s.width, s.height);
2202 addChild(background, -1);
2204 const char* img =
"Images/test_image_rgb888.png";
2205 addImageToDemo(*
this, 1*s.width/9, s.height/2+32, img, backend::PixelFormat::RGBA8888);
2206 addImageToDemo(*
this, 2*s.width/9, s.height/2-32, img, backend::PixelFormat::RGB888);
2207 addImageToDemo(*
this, 3*s.width/9, s.height/2+32, img, backend::PixelFormat::RGB565);
2208 addImageToDemo(*
this, 4*s.width/9, s.height/2-32, img, backend::PixelFormat::A8);
2209 addImageToDemo(*
this, 5*s.width/9, s.height/2+32, img, backend::PixelFormat::I8);
2210 addImageToDemo(*
this, 6*s.width/9, s.height/2-32, img, backend::PixelFormat::AI88);
2211 addImageToDemo(*
this, 7*s.width/9, s.height/2+32, img, backend::PixelFormat::RGBA4444);
2212 addImageToDemo(*
this, 8*s.width/9, s.height/2-32, img, backend::PixelFormat::RGB5A1);
2215 Texture2D::setDefaultAlphaPixelFormat(backend::PixelFormat::DEFAULT);
2216 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