Example #1
0
        public UnoGLView(CGRect rect)
            : base(rect)
        {
            var attribs = new object[] {
                NSOpenGLPixelFormatAttribute.NoRecovery,
                NSOpenGLPixelFormatAttribute.DoubleBuffer,
                NSOpenGLPixelFormatAttribute.ColorSize, 24,
                NSOpenGLPixelFormatAttribute.DepthSize, 16
            };

            var pixelFormat = new NSOpenGLPixelFormat(attribs);

            _openGLContext = new NSOpenGLContext(pixelFormat, null);
            _openGLContext.MakeCurrentContext();

            _notificationProxy = NSNotificationCenter.DefaultCenter.AddObserver(NSView.GlobalFrameChangedNotification, HandleReshape);

            WantsBestResolutionOpenGLSurface = true;

            _unoWindow = new MonoMacPlatformWindow(this);
            _unoGC     = new MonoMacGraphicsContext(this);
        }