Render video to cegui window

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

asjt3
Just popping in
Just popping in
Posts: 10
Joined: Fri Jun 12, 2009 13:54

Render video to cegui window

Postby asjt3 » Fri Apr 08, 2011 18:00

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?

User avatar
Kulik
CEGUI Team
Posts: 1382
Joined: Mon Jul 26, 2010 18:47
Location: Czech Republic
Contact:

Re: Render video to cegui window

Postby Kulik » Fri Apr 08, 2011 20:02

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.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 14 guests