Example #1
0
        public override void DrawRect(CGRect dirtyRect)
        {
            if (!IsInitialized)
            {
                InitGL();
            }

            MakeCurrent();
            DrawNow?.Invoke(this, EventArgs.Empty);
        }
Example #2
0
        public override void DrawRect(CGRect dirtyRect)
        {
            // only init on the first draw, otherwise we're not able to init properly?
            if (!IsInitialized)
            {
                InitGL();
            }
            else
            {
                if (NeedsNewContext)
                {
                    windowInfo = Utilities.CreateMacOSWindowInfo(Window.Handle, Handle);
                    context.Update(windowInfo);
                    NeedsNewContext = false;
                }
                MakeCurrent();
            }

            DrawNow?.Invoke(this, EventArgs.Empty);
        }