How to play a video through MyGUI?

Celebrien

23-08-2008 23:29:43

I need to play a video in the 3d game that I'm developing. What I have is a .mesh with a material attached to it. I tried to load that mesh into a RenderBox, but I need to update it every frame. It didn't wanna run, the game crashed and didn't want to load the video in.

Is there any other way to play a video through MyGUI widgets? If not, it would be very useful to add such functionality to the RenderBox widget :)

~[L]~

24-08-2008 16:41:41

I was thinking to develop this kind of widget on my own, and release it to the MyGUI community, by the moment i don't have time, but yeah, this is a GREAT functionality ...

I was thinking to add this widget with an apart plugin for the theora codec, and the possibility to add more codecs through a plugin fashioned way ..

Anyways, I can't help you now, I'm on my best friends house, so, this Isn't my computer :oops:

Cheers, Alex =D

Celebrien

24-08-2008 17:57:39

Aw, such a pity! :) Thanks anyway. Yeah, if you could find time and develop a video-playing widget, it would be absolutely awesome. I'm sure someone will be in a need of that in the future... :roll:

Altren

06-09-2008 15:33:05

You can set viewport to RenderBox widget. So everything that you can render in ogre you can show in it.

~[L]~

07-09-2008 10:31:42

@Altren : At expenses of this :


mPointer = mMouseRotation ? mPointerKeeper : "";

// ñîçäàåì íîâûé ñöåí ìåíåäæåð
mScene = Ogre::Root::getSingleton().createSceneManager(Ogre::ST_GENERIC, utility::toString(this, "_SceneManagerRenderBox"));

// ñîçäàåì íîä ê êîòîðóìó áóäåì âñÿêóþ äðÿíü àòà÷èòü
mNode = mScene->getRootSceneNode()->createChildSceneNode();

mScene->setAmbientLight(Ogre::ColourValue(0.8, 0.8, 0.8));

// ãëàâíûé èñòî÷íèê ñâåòà
// êîððåêöèÿ ïîä ëåâîñòîðîíþþ ñèñòåìó êîîðäèíàò ñ îñüþ Z íàïðàâëåííóþ ââåðõ
#ifdef LEFT_HANDED_CS_UP_Z
Ogre::Vector3 dir(10, 10, -10);
#else
Ogre::Vector3 dir(-1, -1, 0.5);
#endif

dir.normalise();
Ogre::Light * light = mScene->createLight(utility::toString(this, "_LightRenderBox"));
light->setType(Ogre::Light::LT_DIRECTIONAL);
light->setDirection(dir);

std::string texture(utility::toString(this, "_TextureRenderBox"));
Ogre::TextureManager & manager = Ogre::TextureManager::getSingleton();
manager.remove(texture);
mTexture = manager.createManual(texture, Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
Ogre::TEX_TYPE_2D, TEXTURE_SIZE, TEXTURE_SIZE, 0, Ogre::PF_B8G8R8A8, Ogre::TU_RENDERTARGET)
->getBuffer()->getRenderTarget();

std::string camera(utility::toString(this, "_CameraRenderBox"));
mRttCam = mScene->createCamera(camera);
mRttCam->setNearClipDistance(0.00000001);

mCamNode = mScene->getRootSceneNode()->createChildSceneNode(camera);
mCamNode->attachObject(mRttCam);
mRttCam->setNearClipDistance(1);
if (getHeight() == 0) mRttCam->setAspectRatio(1);
else mRttCam->setAspectRatio(getWidth()/getHeight());

Ogre::Viewport *v = mTexture->addViewport( mRttCam );
v->setOverlaysEnabled(false);
v->setClearEveryFrame( true );
v->setBackgroundColour(mBackgroungColour);
v->setShadowsEnabled(true);
v->setSkiesEnabled(false);


a video stream doesn't require such a thing ...
oh, besides, you have to fight with theora and other codecs, of course ....
If I could have some free time ... T_T

Dew~