I created 2 dynamic link libraries for easy video playback and drawing TTF font in Direct 3D 9 driver in Irrlicht. It uses DirectShow and Overlay.
Download here.
TTF Library:
Code: Select all
Font_SetDevice((LPVOID)driver->getExposedVideoData().D3D9.D3DDev9); //At first you must call this function
//load a Font
CIrrDXFont font("Trajan Pro",24);
//draw text
font.Draw("Some text",0,0,640,100,0xFF00CCFF);//text,x,y,w,h,color(0xAABBGGRR)
Code: Select all
SExposedVideoData evd = driver->getExposedVideoData();
LPVOID cinHandle = PlayMovie((HWND)evd.D3D9.HWnd,"movie.avi",TRUE,evd.D3D9.D3D9,evd.D3D9.D3DDev9);
if(!cinHandle) return 0;
PauseMovie(cinHandle,FALSE); //starts playback
SetForegroundWindow((HWND)evd.D3D9.HWnd);
while(device->run())
{
if(!OnFrame(cinHandle))
break;
}
FreeMovie(cinHandle);