Jump to content
  • Advertisement


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


DirectShow not playing

This topic is 5814 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!