DrawRectangle() static private méthode

Draws a rectangle.
static private DrawRectangle ( Textures texture, Point point, Size size, Color128 color ) : void
texture Textures The texture, or a null reference.
point Point The top-left coordinates in pixels.
size Size The size in pixels.
color Color128 The color, or a null reference.
Résultat void
        //
        // SHOW THE OVERLAY
        //
        /// <summary>Displays the current state into the simulation window.</summary>
        public void Show()
        {
            if (currentState == state.none)
            {
                return;
            }

            int xPos, zPos;
            // size the image to half of the smallest screen size, but not larger than default size
            // NO: compressing the image below its original size makes texs hard to read
            //			int		width		= Math.Min(Math.Min(Screen.Height, Screen.Width) / 2,
            //						Game.RouteInformation.DefaultRouteInfoSize);
            Point origin = new Point(0, 0);

            GL.Color4(1.0f, 1.0f, 1.0f, 1.0f);
            // draw the relevant image
            switch (currentState)
            {
            case state.map:
                Renderer.DrawRectangle(mapImage, origin, mapSize, null);
                // get current train position
                int n = TrainManager.Trains.Length;
                for (int i = 0; i < n; i++)
                {
                    int trainX = (int)TrainManager.Trains[i].Cars[0].FrontAxle.Follower.WorldPosition.X;
                    int trainZ = (int)TrainManager.Trains[i].Cars[0].FrontAxle.Follower.WorldPosition.Z;
                    // convert to route map coordinates
                    xPos = mapSize.Width * (trainX - Game.RouteInformation.RouteMinX) /
                           (Game.RouteInformation.RouteMaxX - Game.RouteInformation.RouteMinX) - trainDotRadius;
                    zPos = mapSize.Height - mapSize.Height * (trainZ - Game.RouteInformation.RouteMinZ) /
                           (Game.RouteInformation.RouteMaxZ - Game.RouteInformation.RouteMinZ) - trainDotRadius;
                    // draw a dot at current train position
                    Renderer.DrawRectangle(null, new Point(xPos, zPos),
                                           new Size(trainDotDiameter, trainDotDiameter),
                                           TrainManager.Trains[i] == TrainManager.PlayerTrain ? playerTrainDotColour : trainDotColour);
                }
                break;

            case state.gradient:
                Renderer.DrawRectangle(gradientImage, origin, gradientSize, null);
                // get current train position in track
                int trackPos = (int)(TrainManager.PlayerTrain.Cars[0].FrontAxle.Follower.TrackPosition
                                     - TrainManager.PlayerTrain.Cars[0].FrontAxle.Position
                                     + 0.5 * TrainManager.PlayerTrain.Cars[0].Length);
                // convert to gradient profile offset
                xPos = gradientSize.Width * (trackPos - Game.RouteInformation.GradientMinTrack) /
                       (Game.RouteInformation.GradientMaxTrack - Game.RouteInformation.GradientMinTrack);
                // draw a vertical bar at the current train position
                Renderer.DrawRectangle(null, new Point(xPos, gradientSize.Height / 2),
                                       new Size(gradientPosWidth, gradientSize.Height / 2), gradientPosBar);
                break;
            }
        }