public void RenderScreenUI(GuiRenderer renderer)
        {
            for (int viewIndex = 0; viewIndex < views.Count; viewIndex++)
            {
                View view = views[viewIndex];

                //draw view on screen
                if (view.Opacity > 0)
                {
                    renderer.PushTextureFilteringMode(GuiRenderer.TextureFilteringModes.Point);
                    renderer.AddQuad(view.Rectangle, new Rect(0, 0, 1, 1), view.Texture,
                                     new ColorValue(1, 1, 1, view.Opacity), true);
                    renderer.PopTextureFilteringMode();
                }

                //draw debug info
                if (drawDebugInfo)
                {
                    Viewport   screenViewport = renderer.ViewportForScreenGuiRenderer;
                    Vec2       pixelOffset    = 1.0f / screenViewport.DimensionsInPixels.Size.ToVec2();
                    ColorValue color          = new ColorValue(1, 1, 0);
                    renderer.AddRectangle(new Rect(
                                              view.Rectangle.LeftTop + pixelOffset,
                                              view.Rectangle.RightBottom - pixelOffset * 2),
                                          color);
                    renderer.AddLine(view.Rectangle.LeftTop, view.Rectangle.RightBottom, color);
                    renderer.AddLine(view.Rectangle.RightTop, view.Rectangle.LeftBottom, color);

                    if (debugFont == null)
                    {
                        debugFont = FontManager.Instance.LoadFont("Default", .03f);
                    }

                    string sizeString = "";
                    if (view.Texture != null)
                    {
                        sizeString = string.Format("{0}x{1}", view.Texture.Size.X, view.Texture.Size.Y);
                    }
                    string text     = string.Format("View {0}, {1}", viewIndex, sizeString);
                    Vec2   position = new Vec2(view.Rectangle.Right - pixelOffset.X * 5, view.Rectangle.Top);
                    AddTextWithShadow(renderer, debugFont, text, position, HorizontalAlign.Right,
                                      VerticalAlign.Top, new ColorValue(1, 1, 1));
                }
            }
        }
        public void RenderScreenUI(GuiRenderer renderer)
        {
            for (int viewIndex = 0; viewIndex < views.Count; viewIndex++)
            {
                View view = views[viewIndex];

                //draw view on screen
                if (view.Opacity > 0)
                {
                    renderer.PushTextureFilteringMode(GuiRenderer.TextureFilteringModes.Point);
                    renderer.AddQuad(view.Rectangle, new Rect(0, 0, 1, 1), view.Texture,
                        new ColorValue(1, 1, 1, view.Opacity), true);
                    renderer.PopTextureFilteringMode();
                }

                //draw debug info
                if (drawDebugInfo)
                {
                    Viewport screenViewport = renderer.ViewportForScreenGuiRenderer;
                    Vec2 pixelOffset = 1.0f / screenViewport.DimensionsInPixels.Size.ToVec2();
                    ColorValue color = new ColorValue(1, 1, 0);
                    renderer.AddRectangle(new Rect(
                        view.Rectangle.LeftTop + pixelOffset,
                        view.Rectangle.RightBottom - pixelOffset * 2),
                        color);
                    renderer.AddLine(view.Rectangle.LeftTop, view.Rectangle.RightBottom, color);
                    renderer.AddLine(view.Rectangle.RightTop, view.Rectangle.LeftBottom, color);

                    if (debugFont == null)
                        debugFont = FontManager.Instance.LoadFont("Default", .03f);

                    string sizeString = "";
                    if (view.Texture != null)
                        sizeString = string.Format("{0}x{1}", view.Texture.Size.X, view.Texture.Size.Y);
                    string text = string.Format("View {0}, {1}", viewIndex, sizeString);
                    Vec2 position = new Vec2(view.Rectangle.Right - pixelOffset.X * 5, view.Rectangle.Top);
                    AddTextWithShadow(renderer, debugFont, text, position, HorizontalAlign.Right,
                        VerticalAlign.Top, new ColorValue(1, 1, 1));
                }
            }
        }