Example #1
0
        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));
        }
Example #2
0
 private void OnExit(object sender, ExitEventArgs e)
 {
     DisposableSerivce.DisposeAll();
 }