static GLService() { Lock = new object(); ContextReferenceCount = new ThreadLocal <int>(() => 0, false); GLWindow = new NativeWindow(); GLGraphicsContext = new GraphicsContext(GraphicsMode.Default, GLWindow.WindowInfo); SubscribeContexts = new ConcurrentDictionary <WindowsFormsHost, SubscribeContext>(); DrawingContexts = new ConcurrentDictionary <Action, DrawingContext>(); GLGraphicsContext.MakeCurrent(null); DisposableSerivce.Register(new DisposableAction(Dispose)); }
private void OnExit(object sender, ExitEventArgs e) { DisposableSerivce.DisposeAll(); }