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

            base.WillMoveToSuperview(newsuper);
        }
        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();
        }