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); }
static void Main() { var appDetails = new MetaAppDetails("MonoDragons.Core", "1.0", Environment.OSVersion.VersionString); var fatalErrorReporter = new ReportErrorHandler(appDetails); Metric.AppDetails = appDetails; Error.HandleAsync(() => { using (var game = Perf.Time("Startup", () => new NeedlesslyComplexMainGame(appDetails.Name, "Logo", new Display(1600, 900, false), SetupScene(), CreateKeyboardController(), fatalErrorReporter))) game.Run(); }, x => fatalErrorReporter.ResolveError(x)).GetAwaiter().GetResult(); }
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); }