Archived

This topic is now archived and is closed to further replies.

BovineFury

DirectShow not playing

Recommended Posts

I am trying to put cut scenes into my Direct3D project using DirectShow. The problem is that sometimes the cut scene will show, and other times nothing is shown. When nothing is shown, DirectShow continues to act as if something is shown and runs for the same amount of time. The scene will always play correctly when I run the project in windowed mode, but only occasionally when the project is in fullscreen. // settings // set the parents window pVW->put_Owner((OAHWND)hwnd); // sets the child window pVW->put_WindowStyle(WS_CHILD | WS_CLIPSIBLINGS); // here we create a RECT in which to draw the child window on RECT vwrect; // get the size of the Parent GetClientRect(hwnd,&vwrect); // set the Child to this position pVW->SetWindowPosition(0,0,vwrect.right,vwrect.bottom); // display first frame of the movie and then start it if(!FAILED(pMC->Pause()) && !FAILED(pMC->Run())) { // set up a nice black screen pRenderEngine->PreRender(); pRenderEngine->ClearScreen(0); pRenderEngine->PostRender(); pRenderEngine->Flip(); // play the movie until it finishes or the user wants to stop while(Update()) ; } // update code while(contin) { // true if the user wants to exit if(DIK_ESCAPE == g_pInputEngine->GetKeyPressed()) { contin = false; } // go ahead and try to play some more else { // has there been a media event? look for end of stream condition if(E_ABORT != pME->GetEvent(&eventCode, ¶m1, ¶m2, 0)) { // free the media event resources if(FAILED(pME->FreeEventParams(eventCode, param1, param2))) { contin = false; } else { // true if the movie is over if(EC_COMPLETE == eventCode) { contin = false; } } } } }

Share this post


Link to post
Share on other sites