Some people reported they can't play my game, while a video recording tool is running at the same time. So, I bought a popular one to test it and as it turns out they are right. ? I get a System.AccessViolationException with HResult=0x80004003 when calling SwapChain.Present. I am developing with DirectX 11 using C# and SharpDX. This problem only happens when a video recording tool is running. After I close it, the runs perfectly fine!
I searched online for this problem, but I did not find a solution. I also read the MSDN page of SwapChain.Present to search for possible error sources. However, according to this page the SwapChain.Present does not throw System.AccessViolationException error messages. So, I assume the problem comes from somewhere else. I tested this problem also with my second game that I am currently developing which is a 2D game that only uses basis DirectX 11 3D stuff and I get the same problem.
I tried to search all the parameters of all the render targets, viewport, swap chain, depth stencil views, etc. to search for something that might conflict with other applications (e.g. forcing my game to use some resource exclusively that might be also used by the video recording tool).
To locate the exact problem, I removed all code from the render loop, except for the SwapChain.Present call. So it was just this single line of code and it still crashed...
Does anyone of you have had a similar problem?