示例#1
0
 public void MakeCurrent(IntPtr xid)
 {
     if (!Glx.MakeContextCurrent(_x11.Display, xid, xid, Handle))
     {
         throw new OpenGlException("glXMakeContextCurrent failed ");
     }
 }
示例#2
0
 public void Dispose()
 {
     Glx.DestroyContext(_x11.Display, Handle);
     if (_ownsPBuffer)
     {
         Glx.DestroyPbuffer(_x11.Display, _defaultXid);
     }
 }
示例#3
0
 public void Dispose()
 {
     _context.Display.GlInterface.Flush();
     Glx.GlxWaitGL();
     _context.Display.SwapBuffers(_info.Handle);
     Glx.GlxWaitX();
     _context.Display.ClearContext();
     _lock.Dispose();
 }
示例#4
0
        public IDisposable MakeCurrent(IntPtr xid)
        {
            var old = new RestoreContext(Glx, _x11.Display);

            if (!Glx.MakeContextCurrent(_x11.Display, xid, xid, Handle))
            {
                throw new OpenGlException("glXMakeContextCurrent failed ");
            }
            return(old);
        }
示例#5
0
        public IDisposable MakeCurrent(IntPtr xid)
        {
            Monitor.Enter(_lock);
            var success = false;

            try
            {
                var old = new RestoreContext(Glx, _x11.Display, _lock);
                if (!Glx.MakeContextCurrent(_x11.Display, xid, xid, Handle))
                {
                    throw new OpenGlException("glXMakeContextCurrent failed ");
                }

                success = true;
                return(old);
            }
            finally
            {
                if (!success)
                {
                    Monitor.Exit(_lock);
                }
            }
        }