Original Post
void CAviEngine::PlayMovieAsTextures() // Grabs A Frame From The Stream
{
if(m_timerUpdate.CheckStatus())
{
m_lpbi = (LPBITMAPINFOHEADER)AVIStreamGetFrame(m_pgf, m_iFrame); // Grab Data From The AVI Stream (note will crash if you can't open the avi)
m_pdata=(char *)m_lpbi+m_lpbi->biSize;//+lpbi->biClrUsed * sizeof(RGBQUAD); // Pointer To Data Returned By AVIStreamGetFrame on;y with 8 bit color
// Convert Data To Requested Bitmap Format
DrawDibDraw (m_hdd, m_hdc, 0, 0, -1, -1, m_lpbi, m_pdata, 0, 0, m_width, m_height, 0);
//get the surface the lock it transfer the data then unlock it
m_hr = m_aviTextures->GetSurfaceLevel(0, &m_pSurface);
m_pSurface->LockRect(&m_rectLocked, NULL, D3DLOCK_DISCARD);
memcpy(m_rectLocked.pBits, data, m_widthTex*m_heightTex*4);
m_pSurface->UnlockRect();
m_timerUpdate.SetTimer(MILLISECONDS, 32);
}
}