Esempio n. 1
0
        // Use this for initialization
        public DesktopCapture(int displayNum)
        {
            this.displayNum = displayNum;

            mouseCapture = new WindowCapture(IntPtr.Zero, true, true);

            Win32Types.RECT screenRect;
            Win32Funcs.GetScreenRect(out screenRect);

            DebugDelegate debugDelegate  = new DebugDelegate(DebugFunction);
            IntPtr        intptrDelegate = Marshal.GetFunctionPointerForDelegate(debugDelegate);

            WindowRenderCS.WindowRenderer.SetDebugFunction(intptrDelegate);

            pluginFunc = ActuallyRenderWindows;

            renderCallbackPointer = Marshal.GetFunctionPointerForDelegate(pluginFunc);

            // You can do a try catch here to test if it is supported


            Texture2D dummyTexture = new Texture2D(10, 10);

            WindowRenderCS.WindowRenderer.InitDeskDupl(dummyTexture.GetNativeTexturePtr(), displayNum);


            desktopTexture = new Texture2D(screenRect.Width, screenRect.Height, TextureFormat.ARGB32, false);

            testPointer = desktopTexture.GetNativeTexturePtr();

            getDesktop = true;
        }