Posted: Thu Aug 24, 2006 11:48 am
thanks for all the video stuff guys, its very useful but I am having one or two problems I am hoping you can help with.
I wanted to draw simple fullscreen movies as 2d images (rather than messing around trying to align the camera and a quad).
So I created my own class which extends the TMovieMesh class created by Emil in this http://www.irrforge.org/index.php/Playi ... in_texture example.
All I have done is overide the render() function, my class looks like so:
(TMovieMesh has been renamed MovieMesh)
when I run the movie in a windowed app it works fine but whne I try and run it in fullscreen it displays the video squashed in to the left half of the screen and the colours look as if somebody has applied a thermal imaging filter(or something similar) to them! The video plays from start to finish and the sound is fine.
I have run the fullscreen (and windowed version) at resolutions from 640x480 - 1280x1024 and always get the same results.
I wanted to draw simple fullscreen movies as 2d images (rather than messing around trying to align the camera and a quad).
So I created my own class which extends the TMovieMesh class created by Emil in this http://www.irrforge.org/index.php/Playi ... in_texture example.
All I have done is overide the render() function, my class looks like so:
(TMovieMesh has been renamed MovieMesh)
Code: Select all
class FSMovie : public MovieMesh
{
public:
FSMovie(irr::scene::ISceneNode* parent, irr::scene::ISceneManager* mgr, irr::s32 id): MovieMesh(parent, mgr, id)
{
}
private:
virtual void render()
{
DrawMovie(0,0,Material.Texture1);
irr::video::IVideoDriver* driver = SceneManager->getVideoDriver();
//take the movie part of the texture
irr::core::rect<s32> texrect;
texrect.UpperLeftCorner.X=0;
texrect.UpperLeftCorner.Y=0;
texrect.LowerRightCorner.X=MovieWidth();
texrect.LowerRightCorner.Y=MovieHeight();
//get the veiwport dimensions to render to
core::rect<s32> viewrect(driver->getViewPort());
//core::rect<s32> viewrect(0,0,256,256);
//use full colour and opacity
video::SColor colours[4];
colours[0].set(255,255,255,255);
colours[1].set(255,255,255,255);
colours[2].set(255,255,255,255);
colours[3].set(255,255,255,255);
char tmp[255];
//core::vector3df pos = device->getSceneManager()->getActiveCamera()->getAbsolutePosition();
sprintf_s(tmp, sizeof(tmp), "VP Dimensions: ULX %d, ULY %d, LRX %d, LRY %d\n", viewrect.UpperLeftCorner.X, viewrect.UpperLeftCorner.Y, viewrect.LowerRightCorner.X, viewrect.LowerRightCorner.Y);
//sceneStartTime - device->getTimer()->getTime());
OutputDebugString(tmp);
//function doesn't work with software rendering
driver->draw2DImage(Material.Texture1,viewrect,texrect,0,0,false);
}
};
I have run the fullscreen (and windowed version) at resolutions from 640x480 - 1280x1024 and always get the same results.