Hello again, I am wondering if there is an alternative to GraphicDevice.GetBackBufferData? It exists in XNA but not in Monogame.
Ultima124:
GetBackBufferData
I implemented it over here:
MonoGame:develop
← danzel:getbackbufferdata
opened 12:27AM - 20 Apr 14 UTC
This allows taking screenshots of your running game!
At the moment the implemen… tation only supports byte[] data and returns the data as RGBA/BGRA 32bit, it could be extended to support more formats.
The format of the pixels differs by platform. XNA and WindowsGL return it in BGRA, WindowsDX, iOS, Android returns it in RGBA.
It should be possible to get WindowsDX to return data in the same format, but this was my first time doing DirectX programming :) (Doing a cpu side swap just so user code can undo it seems wrong)
Android and iOS image code handles RGBA data, so they aren't really an issue.
Only the simplest version of this function is implemented, there are two others which have not been included:
http://msdn.microsoft.com/en-us/library/microsoft.xna.framework.graphics.graphicsdevice.getbackbufferdata.aspx
Tested on iOS, Android, Windows(GL/DX).
I have an example for WindowsDX, WindowsGL, iOS and Android using this here:
https://github.com/danzel/WrapTest/blob/master/WrapTest/WrapTest/Game1.cs#L199-L250
It might be nice to have this example code somewhere, any suggestions?
Fixes #1885
Any conflicts could be fixed to allow merging it if desired.
Depends what you are using it for, it usually isn’t the right way to do things. You could use a RenderTarget2D instead?
Thank you, however if render targets are recommended, then maybe I should use them. I would have to change how my game renders visuals abit I guess. I already use render targets.