aglSetCurrentContext() 정적인 개인적인 메소드

static private aglSetCurrentContext ( IntPtr context ) : bool
context IntPtr
리턴 bool
예제 #1
0
 public override void MakeCurrent(IWindowInfo window)
 {
     if (Agl.aglSetCurrentContext(Handle.Handle) == false)
     {
         MyAGLReportError("aglSetCurrentContext");
     }
 }
예제 #2
0
        protected override void Dispose(bool disposing)
        {
            if (IsDisposed || ContextHandle == IntPtr.Zero)
            {
                return;
            }

            Debug.Print("Disposing of AGL context.");
            Agl.aglSetCurrentContext(IntPtr.Zero);

            //Debug.Print("Setting drawable to null for context {0}.", Handle.Handle);
            //Agl.aglSetDrawable(Handle.Handle, IntPtr.Zero);

            // I do not know MacOS allows us to destroy a context from a separate thread,
            // like the finalizer thread.  It's untested, but worst case is probably
            // an exception on application exit, which would be logged to the console.
            Debug.Print("Destroying context");
            byte code = Agl.aglDestroyContext(ContextHandle);

            try {
                Agl.CheckReturnValue(code, "aglDestroyContext");
                ContextHandle = IntPtr.Zero;
                Debug.Print("Context destruction completed successfully.");
            } catch (MacOSException) {
                Debug.Print("Failed to destroy context.");
                if (disposing)
                {
                    throw;
                }
            }
            IsDisposed = true;
        }
예제 #3
0
        void Dispose(bool disposing)
        {
            if (IsDisposed || Handle.Handle == IntPtr.Zero)
            {
                return;
            }
            Debug.Print("Disposing of AGL context.");
            Agl.aglSetCurrentContext(IntPtr.Zero);
            //Debug.Print("Setting drawable to null for context {0}.", Handle.Handle);
            //Agl.aglSetDrawable(Handle.Handle, IntPtr.Zero);

            // I do not know MacOS allows us to destroy a context from a separate thread,
            // like the finalizer thread.  It's untested, but worst case is probably
            // an exception on application exit, which would be logged to the console.
            Debug.Print("Destroying context");
            if (Agl.aglDestroyContext(Handle.Handle) == true)
            {
                Debug.Print("Context destruction completed successfully.");
                Handle = ContextHandle.Zero;
                return;
            }

            // failed to destroy context.
            Debug.WriteLine("Failed to destroy context.");
            Debug.WriteLine(Agl.ErrorString(Agl.GetError()));
            // don't throw an exception from the finalizer thread.
            if (disposing)
            {
                throw new MacOSException((OSStatus)Agl.GetError(), Agl.ErrorString(Agl.GetError()));
            }

            IsDisposed = true;
        }
예제 #4
0
 public override void MakeCurrent(IWindowInfo window)
 {
     if (Agl.aglSetCurrentContext(this.Handle.Handle))
     {
         return;
     }
     this.MyAGLReportError("aglSetCurrentContext");
 }
예제 #5
0
 private void Dispose(bool disposing)
 {
     if (this.IsDisposed || this.Handle.Handle == IntPtr.Zero)
     {
         return;
     }
     Agl.aglSetCurrentContext(IntPtr.Zero);
     if (Agl.aglDestroyContext(this.Handle.Handle))
     {
         this.Handle = ContextHandle.Zero;
     }
     else
     {
         if (disposing)
         {
             throw new MacOSException((OSStatus)Agl.GetError(), Agl.ErrorString(Agl.GetError()));
         }
         this.IsDisposed = true;
     }
 }
예제 #6
0
        void Dispose(bool disposing)
        {
            if (IsDisposed || Handle.Handle == IntPtr.Zero)
            {
                return;
            }

            Debug.Print("Disposing of AGL context.");

            try
            {
                throw new Exception();
            }
            catch (Exception e)
            {
                Debug.WriteLine(e.StackTrace);
            }

            Agl.aglSetCurrentContext(IntPtr.Zero);
            Agl.aglSetDrawable(Handle.Handle, IntPtr.Zero);

            Debug.Print("Set drawable to null for context {0}.", Handle.Handle);

            if (Agl.aglDestroyContext(Handle.Handle) == true)
            {
                Handle = ContextHandle.Zero;
                return;
            }

            // failed to destroy context.
            Debug.WriteLine("Failed to destroy context.");
            Debug.WriteLine(Agl.ErrorString(Agl.GetError()));

            // don't throw an exception from the finalizer thread.
            if (disposing)
            {
                throw new MacOSException((OSStatus)Agl.GetError(), Agl.ErrorString(Agl.GetError()));
            }

            IsDisposed = true;
        }
예제 #7
0
        void MakeCurrent(INativeWindow window)
        {
            byte code = Agl.aglSetCurrentContext(ContextHandle);

            Agl.CheckReturnValue(code, "aglSetCurrentContext");
        }
예제 #8
0
        public override void MakeCurrent(IWindowInfo window)
        {
            byte code = Agl.aglSetCurrentContext(ContextHandle);

            Agl.CheckReturnValue(code, "aglSetCurrentContext");
        }