Beispiel #1
0
            public unsafe DelegateSaver(ICallbackHandler handler, CallbackShim *shim)
            {
                this.handler         = handler;
                reportError          = ReportError;
                reportDebug          = ReportDebug;
                profilerBegin        = ProfilerBegin;
                profilerBeginLiteral = ProfilerBegin;
                profilerEnd          = ProfilerEnd;
                getCachedSize        = GetCachedSize;
                getCacheEntry        = GetCacheEntry;
                setCacheEntry        = SetCacheEntry;
                saveScreenShot       = SaveScreenShot;
                captureStarted       = CaptureStarted;
                captureFinished      = CaptureFinished;
                captureFrame         = CaptureFrame;

                shim->reportError          = Marshal.GetFunctionPointerForDelegate(reportError);
                shim->reportDebug          = Marshal.GetFunctionPointerForDelegate(reportDebug);
                shim->profilerBegin        = Marshal.GetFunctionPointerForDelegate(profilerBegin);
                shim->profilerBeginLiteral = Marshal.GetFunctionPointerForDelegate(profilerBeginLiteral);
                shim->profilerEnd          = Marshal.GetFunctionPointerForDelegate(profilerEnd);
                shim->getCachedSize        = Marshal.GetFunctionPointerForDelegate(getCachedSize);
                shim->getCacheEntry        = Marshal.GetFunctionPointerForDelegate(getCacheEntry);
                shim->setCacheEntry        = Marshal.GetFunctionPointerForDelegate(setCacheEntry);
                shim->saveScreenShot       = Marshal.GetFunctionPointerForDelegate(saveScreenShot);
                shim->captureStarted       = Marshal.GetFunctionPointerForDelegate(captureStarted);
                shim->captureFinished      = Marshal.GetFunctionPointerForDelegate(captureFinished);
                shim->captureFrame         = Marshal.GetFunctionPointerForDelegate(captureFrame);
            }
Beispiel #2
0
            public unsafe DelegateSaver(ICallbackHandler handler, CallbackShim* shim)
            {
                this.handler = handler;
                reportError = ReportError;
                reportDebug = ReportDebug;
                getCachedSize = GetCachedSize;
                getCacheEntry = GetCacheEntry;
                setCacheEntry = SetCacheEntry;
                saveScreenShot = SaveScreenShot;
                captureStarted = CaptureStarted;
                captureFinished = CaptureFinished;
                captureFrame = CaptureFrame;

                shim->reportError = Marshal.GetFunctionPointerForDelegate(reportError);
                shim->reportDebug = Marshal.GetFunctionPointerForDelegate(reportDebug);
                shim->getCachedSize = Marshal.GetFunctionPointerForDelegate(getCachedSize);
                shim->getCacheEntry = Marshal.GetFunctionPointerForDelegate(getCacheEntry);
                shim->setCacheEntry = Marshal.GetFunctionPointerForDelegate(setCacheEntry);
                shim->saveScreenShot = Marshal.GetFunctionPointerForDelegate(saveScreenShot);
                shim->captureStarted = Marshal.GetFunctionPointerForDelegate(captureStarted);
                shim->captureFinished = Marshal.GetFunctionPointerForDelegate(captureFinished);
                shim->captureFrame = Marshal.GetFunctionPointerForDelegate(captureFrame);
            }