Hello Everybody
In My application I want to convert ogre::TexturePtr to CEGUI::Texture and then want to display it on our Widget. My application is crashing on startRendering ()
Below is block of code –
OgreCEGUIRenderer* renderer = (OgreCEGUIRenderer*)CEGUI::System::getSingleton().getRenderer();
CEGUI::Texture *myTextureC = renderer->createTexture((utf8*)"Cam3.jpg");
Ogre::TexturePtr txtC = ((OgreCEGUITexture*)myTextureC)->getOgreTexture();
void* tmpTxtC = (void*)(&txtC);
Ogre::TexturePtr myTexture = (Ogre::TexturePtr &)(tmpTxtC);
uint height = txtC->getHeight();
uint width = txtC->getWidth();
CEGUI::Texture *orgTexture = renderer->createTexture(myTexture);
CEGUI::Imageset* ImageSet1 =
CEGUI::ImagesetManager::getSingleton().createImageset(
(CEGUI::utf8*)"DefineImageset", orgTexture);
ImageSet1->defineImage((CEGUI::utf8*)"ogreImage",
CEGUI::Point(0.0f, 0.0f),
CEGUI::Size(width, height),
CEGUI::Point(0.0f,0.0f));
CEGUI::StaticImage* si = (CEGUI::StaticImage*)CEGUI::WindowManager::getSingleton().createWindow((CEGUI::utf8*)"TaharezLook/StaticImage", (CEGUI::utf8*)"staticimage1");
si->setSize(CEGUI::Size(0.3f, 0.2f));
si->setImage(&ImageSet1->getImage((CEGUI::utf8*)"ogreImage"));
fwnd1->addChildWindow(si);
si->setPosition(Point(0.1f,0.1f));
All code is running perfectly if I remove these lines
void* tmpTxtC = (void*)(&txtC);
Ogre::TexturePtr myTexture = (Ogre::TexturePtr &)(tmpTxtC);
but according to my requirement i have to don in this way only.
Anyone tell me what is the problem when I convert TexturePtr to (Void*) and again in TexturePtr.
Thanks
Regards
Parul
Ogre::TexturePtr to CEGUI::Texture conversion
Moderators: CEGUI MVP, CEGUI Team
- lindquist
- CEGUI Team (Retired)
- Posts: 770
- Joined: Mon Jan 24, 2005 21:20
- Location: Copenhagen, Denmark
Re: Ogre::TexturePtr to CEGUI::Texture conversion
how about this: ???
and why on earth do you want to do this ?
Code: Select all
void* tmpTxtC = (void*)(&txtC);
Ogre::TexturePtr& myTexture = *((Ogre::TexturePtr*)tmpTxtC);
and why on earth do you want to do this ?
Re: Ogre::TexturePtr to CEGUI::Texture conversion
Hmm, I replied in this same post you have at the Ogre forums... If you search the forums here, you will should find your answer... If not, I also said I have an example in ogreaddons.
Casting the MaterialPtr is *NOT* neccessary (or required).
Casting the MaterialPtr is *NOT* neccessary (or required).
Return to “Modifications / Integrations / Customisations”
Who is online
Users browsing this forum: No registered users and 8 guests