I have a simple Unity3D-scene for Oculus Rift and want to add ability to show his own desktop to a user(from main monitor). I've found that I can render it to a Texture2D, but how to efficiently capture a desktop?
Actually, I need to provide something like http://www.vrdesktop.net/, which allows to the user see his monitor's content inside VR. But I need to implement this as a library for Unity3D. So what is the best way to do that?
P.S. It would be nice to have a cross-platform solution, at least Windows and Linux/Mac.
This one works (at least for Windows):
But efficiency is questionable here - every frame is converted to PNG, on the other hand capturing with CopyFromScreen works fine.
(Limitations) As it said in the Mono documentation: "Works on Win32 and on X11 (but not on Cocoa and Quartz)"