It's me again with another annoying question ;)
In my little demo I use Two-Pass-Rendering:
In the first step I render everything to the back-buffer.
After that, the buffer is copied to a texture with
In the second step the copied texture is rendered on a big quad.
Everytime the demo is running and I swith to the desktop (pressing [Windows] + [D]), I get an
AccessViolationException: "Attemped to read or write from protected memory"
This also happens If I swith to another graphics application.
static int TEX_SIZE = 512; GL.BindTexture(TextureTarget.Texture2d, texRender); GL.CopyTexImage2D(TextureTarget.Texture2d, 0, PixelInternalFormat.Rgba, 0, 0, TEX_SIZE, TEX_SIZE, 0); // ^^^ The exception occurs here
I added an example of the Two-Pass-Rendering mentioned above, using the QuickStart-Project. Check out the RenderFrame-method. While executing switch to the windows desktop (e.g. [Windows] + [D]).