예제 #1
0
        static Device()
        {
            OpenTK.Graphics.GraphicsContext.ShareContexts = true;
            toolkit = OpenTK.Toolkit.Init();

            sharedWindow = new GameWindow(10, 10, GraphicsMode.Default, "shared context window", GameWindowFlags.Default, DisplayDevice.Default, 4, 0, GraphicsContextFlags.Default);
            sharedContext = new Context(sharedWindow.Context, sharedWindow.WindowInfo);
            sharedWindow.Disposed += (sender, args) => { throw new Exception(); };

            capabilities = new Capabilities();
        }
예제 #2
0
 public bool MakeCurrent()
 {
     try {
         context.MakeCurrent(window);
         current = this;
         return true;
     } catch (GraphicsContextException) {
         return false;
     }
 }