using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VisiMath;

namespace VisimBox.Renderer
{
    /// <summary>
    /// Viewport (window) for showing scene. Renderer window can contain many different viewports for different cameras/view settings.
    /// </summary>
    public struct Viewport
    {
        /// <summary>
        /// Rendering context for the viewport
        /// </summary>
        public IRenderContext Context;

        /// <summary>
        /// ViewPort coordinates in the window
        /// </summary>
        public System.Drawing.Rectangle Coordinates;

        /// <summary>
        /// Camera to use
        /// </summary>
        public ICamera Camera;

        /// <summary>
        /// Set view quality for the viewport
        /// </summary>
        public ViewQuality ViewQual;

        /// <summary>
        /// Is viewport currently active? NOTE - make it readonly!!!
        /// </summary>
        public bool Active;        

        public Viewport(IRenderContext rencont, int left, int top, int right, int bottom)
        {
            Context = rencont;
            Coordinates = new System.Drawing.Rectangle(left, top, right - left, bottom - top);
            Camera = null;
            ViewQual = new ViewQuality();
            Active = true;
        }

        public Viewport(IRenderContext rencont, System.Drawing.Rectangle coords)
        {
            Context = rencont;
            Coordinates = coords;
            Camera = null;
            ViewQual = new ViewQuality();
            Active = true;
        }
    }
}
