Esempio n. 1
0
        public override void WillMoveToSuperview(UIView newsuper)
        {
            if (!_initialized)
            {
                GraphicsInitialize?.Invoke(this, new GraphicsEventArgs(_graphicsDevice, _swapChain));
                _initialized = true;
            }

            base.WillMoveToSuperview(newsuper);
        }
Esempio n. 2
0
        private void OnLoaded(object sender, RoutedEventArgs e)
        {
            if (_swapChain != null)
            {
                return;
            }

            _swapChain = new SwapChain(
                GraphicsDevice,
                Handle,
                3,
                Math.Max((int)ActualWidth, 1),
                Math.Max((int)ActualHeight, 1));

            GraphicsInitialize?.Invoke(this, new GraphicsEventArgs(GraphicsDevice, _swapChain));

            StartRenderLoop();
        }