//创建嵌入CEGUI组建中的画中画 TexturePtr rttTex = TextureManager::getSingleton().createManual("RttTex", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, TEX_TYPE_2D, 512, 512, 1, 0, PF_R8G8B8, TU_RENDERTARGET); { Camera* rttCam = mSceneMgr->getCamera("pictureCerame"); Viewport *v = rttTex->getBuffer()->getRenderTarget()->addViewport( rttCam ); v->setOverlaysEnabled(false); v->setClearEveryFrame( true ); v->setBackgroundColour( ColourValue::Black ); } CEGUI::Texture* rttTexture = mGUIRender->createTexture(rttTex); CEGUI::Imageset* rttImageSet = CEGUI::ImagesetManager::getSingleton().createImageset("RttImageset", rttTexture); rttImageSet->defineImage("RttImage", CEGUI::Point(0.0f, 0.0f), CEGUI::Size(rttTexture->getWidth(), rttTexture->getHeight()),CEGUI::Point(0.0f,0.0f)); CEGUI::Window* sheet = CEGUI::WindowManager::getSingleton().createWindow( "DefaultWindow", "root" ); mGUISystem->setGUISheet(sheet); CEGUI::Window* fWnd = (CEGUI::FrameWindow*)CEGUI::WindowManager::getSingleton().createWindow( "TaharezLook/StaticImage", "testWindow" ); fWnd->setProperty("Image", CEGUI::PropertyHelper::imageToString(&rttImageSet->getImage((CEGUI::utf8*)"RttImage"))); 说明:显示的CEGUI窗体应该为StaticImage,其他类型的将会崩溃.