Page 1 of 1

Render video to cegui window

Posted: Fri Apr 08, 2011 18:00
by asjt3
Hey guys,

I'm using delta3d 2.5.0 and trying to render a video to a CEGUI::StaticImage window. I've got an osg::texture2d that contains the video and I can successfully render to objects in the scene, but when I try to render to the cegui window, the render surface just turns white.

I'm using the following code :

Code: Select all

CEGUI::Texture *Ctex = (CEGUI::Texture*)m_TextureTarget;
               
CEGUI::ImagesetManager::getSingletonPtr()->create("Test_Movie",*Ctex);
      
CEGUI::ImagesetManager::getSingletonPtr()->get("Test_Movie").defineImage("newImg",CEGUI::Point(1.f,1.f),CEGUI::Size(20.f,20.f),CEGUI::Point(1.f,1.f));
            
CEGUI::Window* actionAreaIntroImage = _gui->GetWidget("DemoWindow");
            
actionAreaIntroImage->setProperty("Image","set:Test_Movie image:newImg");


Any ideas as to why this wouldn't work? I've tried the Delta3d forums and they pointed me here.

Thanks,

Alex

PS I think the trouble lies in my casting osg::texture2D as a CEGUI::Texture, but I'm not sure how to get around it?

Re: Render video to cegui window

Posted: Fri Apr 08, 2011 20:02
by Kulik
What is m_TextureTarget?

EDIT: Oh it's osg:texture2D. Yeah you definitely can't cast that like this I think. You can create OpenGL CEGUI textures from their resource ids though.

Code: Select all

tex = static_cast<CEGUI::OpenGLTexture*>(CEGUI::System::getSingleton().getRenderer()->createTexture("MyTexture"));
tex->setOpenGLTexture(internalResourceID, size);


You can then use this texture to define a image inside an imageset.