Original Post
I have multiple windows using d3d9. I share one device between them all. Each one has its own swap chain. Some of them have 3d content ( SetRenderTarget() -> BeginScene() -> EndScene() -> Present() ) and some of them display video frames ( GetDC() -> Present() ). Well thats a general overview of what I have anyway. Now the 3d window is fine when there is no video playing. Can rotate the scene around very fast. When I play video in another window, the 3d scene usually doesn't render correctly. It occasionally does but most of the time it's missing large chunks. I am guessing this is to do with a lack of any critical sections in the code. I put one around all the 3d rendering block but it doesn't make much difference. Not sure what bits of d3d need to be locked and whether or not to use the D3DCREATE_MULTITHREADED flag when creating the device?