This keeps happening to me, I just can't escape from it.
Grabber grab; //this is a class I made which uses VFWint nCurrentFrame = 0;int nFrameCount = 0;double dElapsedTime = 0;void UpdateMeshWithFrame(){ tex01->GetSurfaceLevel(0, &surf01); HDC hdc1 = NULL; surf01->GetDC(&hdc1); FloodFill(hdc1, 0, 0, RGB(0, 0, 0)); BYTE* pDIB = (BYTE*)grab.GetAFrame(nCurrentFrame); BITMAPINFOHEADER bih; RtlMoveMemory(&bih.biSize, pDIB, sizeof(BITMAPINFOHEADER)); BYTE* Bits=new BYTE[bih.biSizeImage]; memcpy(Bits, pDIB, bih.biSizeImage); BITMAPINFO bmi; bmi.bmiHeader = bih; StretchDIBits(hdc1, 0, 0, 512, 512, 0, 0, 512, 512, Bits, &bmi, DIB_RGB_COLORS, SRCCOPY); delete [] Bits; surf01->ReleaseDC(hdc1); surf01->Release(); }void CheckTime(){ if(nCurrentFrame >= nFrameCount) nCurrentFrame = 0; //.04 is 1/25 or 1 second divided by 25 frames. dElapsedTime = dElapsedTime + timer1.elapsed(); if(dElapsedTime >= .04){ nCurrentFrame++; dElapsedTime = 0; } timer1.restart();}