
#ifndef __WFX_RENDERER_VIEWPORT_H__
#define __WFX_RENDERER_VIEWPORT_H__

#include <WFX/WFXIncludes.h>

namespace WFX {

    namespace renderer {

        class RenderTarget;

        /**
         * Viewport
         * The viewport is where a camera meets the rendertarget.
         * The camera renders the scene from a given viewpoint and places
         * the results on a subset of the rendertarget. this class represents
         * such a subset
         * A Viewport is a rectangle defined by the bottom left corner and the
         * width and height
         * Viewport coordinates and dimensions are Real values so you can specify
         * them without knowing Rendertarget dimensions
         * Just be careful when you are overlapping viewports - this may lead to
         * strange effects...
         */
        class Viewport {
            public:

                /** 
                 * Ctor 
                 */
                Viewport(Real t, Real l, Real w, Real h);

                /** returns Left */
                inline Real getLeft() {
                    return Left;
                }
                /** sets Left */
                inline void setLeft(Real l) {
                    Left = l;
                }
                /** returns Bottom */
                inline Real getBottom() {
                    return Bottom;
                }
                /** sets Bottom */
                inline void setBottom(Real l) {
                    Bottom = l;
                }
                /** returns Width */
                inline Real getWidth() {
                    return Width;
                }
                /** sets Width */
                inline void setWidth(Real l) {
                    Width = l;
                }
                /** returns Height */
                inline Real getHeight() {
                    return Height;
                }
                /** sets Height */
                inline void setHeight(Real l) {
                    Height = l;
                }
                
                /** returns ActLeft */
                inline UInt getActLeft() {
                    return ActLeft;
                }
                /** sets ActLeft */
                inline void setActLeft(UInt l) {
                    ActLeft = l;
                }
                /** returns ActBottom */
                inline UInt getActBottom() {
                    return ActBottom;
                }
                /** sets ActBottom */
                inline void setActBottom(UInt l) {
                    ActBottom = l;
                }
                /** returns ActWidth */
                inline UInt getActWidth() {
                    return ActWidth;
                }
                /** sets ActWidth */
                inline void setActWidth(UInt l) {
                    ActWidth = l;
                }
                /** returns ActHeight */
                inline UInt getActHeight() {
                    return ActHeight;
                }
                /** sets ActHeight */
                inline void setActHeight(UInt l) {
                    ActHeight = l;
                }


                /** print some debug info */
                void printDebug();

            protected:
                /** rel top left corner */
                Real Bottom, Left;
                /** rel dimensions */
                Real Width, Height;
                /** actual top left corner */
                UInt ActBottom, ActLeft;
                /** actual dimensions */
                UInt ActWidth, ActHeight;
                
            
            private:

        };

    }

}


#endif //include guard


