Пример #1
0
        /// <summary>
        /// Clears the background of the graphics context.
        /// </summary>
        /// <param name="graphics">Graphics context</param>
        public void Draw(IGraphicsService graphics)
        {
            if (graphics == null)
            {
                throw new ArgumentNullException("graphics");
            }

            graphics.Clear(_color);
        }
Пример #2
0
        /// <summary>
        /// Begins the rendering process on all layers.
        /// </summary>
        private void BeginLayerRender()
        {
            if (_graphicsService == null)
            {
                _graphicsService = GameResourceFactory?.CreateGraphicsService();
            }

            _graphicsService.Clear(BackgroundColor);
            foreach (var layer in _layers.Values)
            {
                layer.Begin();
            }
        }