aglSetDrawable() static private méthode

static private aglSetDrawable ( AGLContext ctx, AGLDrawable draw ) : void
ctx AGLContext
draw AGLDrawable
Résultat void
Exemple #1
0
        private void SetDrawable(IWindowInfo carbonWindow)
        {
            IntPtr windowPort = GetWindowPortForWindowInfo(carbonWindow);

            //Debug.Print("Setting drawable for context {0} to window port: {1}", Handle.Handle, windowPort);
            Agl.aglSetDrawable(Context.Handle, windowPort);
            MyAGLReportError("aglSetDrawable");
        }
        void SetDrawable(CarbonWindowInfo carbonWindow)
        {
            IntPtr windowPort = GetWindowPortForWindowInfo(carbonWindow);

            Agl.aglSetDrawable(Handle.Handle, windowPort);

            MyAGLReportError("aglSetDrawable");
        }
Exemple #3
0
        internal void UnsetFullScreen(CarbonWindowInfo windowInfo)
        {
            Agl.aglSetDrawable(this.Handle.Handle, IntPtr.Zero);
            int num1 = (int)Agl.aglUpdateContext(this.Handle.Handle);
            int num2 = (int)CG.DisplayRelease(this.GetQuartzDevice(windowInfo));

            this.SetDrawable(windowInfo);
            this.mIsFullscreen = false;
        }
Exemple #4
0
        void SetDrawable(CarbonWindow window)
        {
            IntPtr windowPort = API.GetWindowPort(window.WinHandle);
            //Debug.Print("Setting drawable for context {0} to window port: {1}", Handle.Handle, windowPort);

            byte code = Agl.aglSetDrawable(ContextHandle, windowPort);

            Agl.CheckReturnValue(code, "aglSetDrawable");
        }
Exemple #5
0
 internal void UnsetFullScreen(CarbonWindowInfo windowInfo)
 {
     Debug.Print("Unsetting AGL fullscreen.");
     Agl.aglSetDrawable(Handle.Handle, IntPtr.Zero);
     Agl.aglUpdateContext(Handle.Handle);
     CG.DisplayRelease(GetQuartzDevice(windowInfo));
     Debug.Print("Resetting drawable.");
     SetDrawable(windowInfo);
     mIsFullscreen = false;
 }
Exemple #6
0
        internal void UnsetFullScreen(CarbonWindow window)
        {
            Debug.Print("Unsetting AGL fullscreen.");
            byte code = Agl.aglSetDrawable(ContextHandle, IntPtr.Zero);

            Agl.CheckReturnValue(code, "aglSetDrawable");
            code = Agl.aglUpdateContext(ContextHandle);
            Agl.CheckReturnValue(code, "aglUpdateContext");

            CG.CGDisplayRelease(CG.CGMainDisplayID());
            Debug.Print("Resetting drawable.");
            SetDrawable(window);

            mIsFullscreen = false;
        }
        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;
        }
Exemple #8
0
 private void SetDrawable(CarbonWindowInfo carbonWindow)
 {
     Agl.aglSetDrawable(this.Handle.Handle, AglContext.GetWindowPortForWindowInfo(carbonWindow));
     this.MyAGLReportError("aglSetDrawable");
 }
 internal void UnsetFullScreen(CarbonWindowInfo windowInfo)
 {
     Agl.aglSetDrawable(Handle.Handle, IntPtr.Zero);
     SetDrawable(windowInfo);
 }