Video and true type font libraries

A forum to store posts deemed exceptionally wise and useful
Post Reply
Kalda
Posts: 47
Joined: Wed Aug 23, 2006 1:38 pm
Location: Prostejov, Czech Republic
Contact:

Video and true type font libraries

Post by Kalda »

Hello.
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)

Video library:

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);

Last edited by Kalda on Sat May 12, 2007 8:25 am, edited 1 time in total.
Ico
Posts: 289
Joined: Tue Aug 22, 2006 11:35 pm

Post by Ico »

Imo you should do all those casts within your functions. If the passed driver isn't D3D9 throw some error and you're done. :)
Kalda
Posts: 47
Joined: Wed Aug 23, 2006 1:38 pm
Location: Prostejov, Czech Republic
Contact:

Post by Kalda »

Ok. It's only for D3D9. You cannot select other driver, but you're right. I'll add it into DLLs.

And please, send me info about all crashes and bugs.

P.S.: You can use this:

Code: Select all

LPVOID cinHandle = PlayMovie(hWnd,"movie.avi",FALSE,NULL,NULL);
//This create new internal D3D9 device and destroy it when playing is complete
christianclavet
Posts: 1638
Joined: Mon Apr 30, 2007 3:24 am
Location: Montreal, CANADA
Contact:

Post by christianclavet »

The download link is down. Is there a way to retrieve this?
stash
Posts: 47
Joined: Wed Dec 12, 2007 11:28 am
Location: Brasil, SC

link dead

Post by stash »

Really! The link is dead.. please, see this..
Grumpy
Posts: 77
Joined: Wed Dec 30, 2009 7:17 pm
Location: Montana, Usa

Post by Grumpy »

Bump.... link is still dead, Jim....
code happens
Post Reply