directx screenshots

Started by
5 comments, last by jast112 16 years ago
Hello. I have problem when my game is in opengl mode it takes black screenshots what should be the problem? Here is the screenshot code. PresentParameters PresentParams = new PresentParameters(); PresentParams.Windowed = true; PresentParams.SwapEffect = Microsoft.DirectX.Direct3D.SwapEffect.Discard; DXDevice = new Microsoft.DirectX.Direct3D.Device(0,DeviceType.Hardware, this,CreateFlags.SoftwareVertexProcessing, PresentParams); Surface buff = DXDevice.CreateOffscreenPlainSurface(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height, Format.A8R8G8B8, Pool.SystemMemory); DXDevice.GetFrontBufferData(0, buff); SurfaceLoader.Save(@"D:\test.bmp", ImageFileFormat.Bmp, buff);
Advertisement
So when your game uses OpenGL for rendering, you're still using Direct3D to capture screenshots? I doubt that will work...
so u should take the screenshots with opengl or what?
I would say yes. It's just very unlikely that OpenGL and D3D will work at the same time.
Thanks for your quick answers.

But can u point me a direction where can i see informtion about C# opengl.
Opengl im pretty dum :D
Doing a search for "OpenGL screenshot" returns many results (like this one). It's not in C#, but converting it should be easy (because the OpenGL calls are the same).
Thanks Gage64 Your very helpful.

This topic is closed to new replies.

Advertisement