I have the same question. Based on a lot of puzzling with old code snippets, the documentation and the 0.8 changelog I've come up with the following code. But I'm still doing something wrong
Code: Select all
// make the texture
CEGUI::Texture &guiTex = mRenderer->createTexture("texname", tex);
// put the texture in an image
const CEGUI::Rectf rect(CEGUI::Vector2f(0.0f, 0.0f), guiTex.getOriginalDataSize());
CEGUI::BasicImage image("RTTImage", &guiTex, rect, CEGUI::Vector2f(0, 0), CEGUI::AutoScaledMode::ASM_Both, CEGUI::Sizef(0, 0));
// add the image to the image manager
CEGUI::ImageManager::getSingleton().addImageType<CEGUI::BasicImage>("RTTImageset");
CEGUI::ImageManager::getSingleton().create("RTTImageset", "RTTImage");
// make a static window
CEGUI::Window *si = CEGUI::WindowManager::getSingleton().createWindow("TaharezLook/StaticImage", "RTTWindow");
si->setSize(CEGUI::USize(CEGUI::UDim(0.5f, 0), CEGUI::UDim(0.4f, 0)));
si->setPosition(CEGUI::UVector2(CEGUI::UDim(0.5f, 0.0), CEGUI::UDim(0.0f, 0.0f)));
// set the image on the static window
si->setProperty("Image", "RTTImage");
root->addChild(si);
This all runs fine, without any warnings in the cegui.log file. Until the si->setProperty("Image", "RTTImage"); line, at which the program crashes. What am I doing wrong? Or where can I find more info on RTT in cegui 0.8 ?
Thanks!