Hi! I'm trying to play video file using this code (I'll show part of it here)
But all I can see on screen is the first frame of video. The NextFrame method works fine and it loops throught all file, but no results are shown on screen. I did mencode video before use and tryed to adapt flip() method here, but with no luck. What kind of mistake had I made?
- Code:
HRESULT InitialApplication::onNextFrame(Surface* pBackBuffer)
{
if (gamestate == 2)
{
if(introvideo.open(TEXT("new.mpg"))==ReturnCode::OK){
HRESULT hr = introvideo.getNextFrame(&videosurface;);
switch(hr){
case ReturnCode::OK:
//blit the image to the screen
pBackBuffer->bltFast(0, 0, &videosurface;);
frame++;
break;
case ReturnCode::END_OF_VIDEO:
//Video is over
gamestate = 0;
break;
default:
shutdown();
break;
}
}
But all I can see on screen is the first frame of video. The NextFrame method works fine and it loops throught all file, but no results are shown on screen. I did mencode video before use and tryed to adapt flip() method here, but with no luck. What kind of mistake had I made?