
#ifndef __WFX_RENDERER_RENDERJOB_H__
#define __WFX_RENDERER_RENDERJOB_H__

#include <WFX/WFXIncludes.h>

#include <WFX/renderer/Renderable.h>
#include <WFX/renderer/Camera.h>
#include <WFX/renderer/Viewport.h>

namespace WFX {

    namespace renderer {

        /**
         * RenderJob
         * A RenderJob contains a Renderable, a Camera, and a Viewport
         * and may be attached to a RenderTarget.
         * describes "Render this Renderable to this RenderTarget using this
         * Camera and put the results on this part of the Target."
         */
        class RenderJob {
            public:
                /** job prio, defaults to 10 */
                Long Priority;

                /** 
                 * Ctor 
                 */
                RenderJob(WFX::renderer::Renderable* r, WFX::renderer::Camera* c, WFX::renderer::Viewport* v);

                /** returns Renderable */
                inline WFX::renderer::Renderable* getRenderable() {
                    return Renderable;
                }
                /** sets the Renderable */
                inline void setRenderable(WFX::renderer::Renderable* r) {
                    Renderable = r;
                }
                /** returns Camera */
                inline WFX::renderer::Camera* getCamera() {
                    return Camera;
                }
                /** sets the Camera */
                inline void setCamera(WFX::renderer::Camera* r) {
                    Camera = r;
                }
                /** returns Viewport */
                inline WFX::renderer::Viewport* getViewport() {
                    return Viewport;
                }
                /** sets the Viewport */
                inline void setViewport(WFX::renderer::Viewport* r) {
                    Viewport = r;
                }
                
                /** active job */
                inline void activate() {
                    Active = true;
                }
                /** deactive job */
                inline void deactivate() {
                    Active = false;
                }
                /** set active state */
                inline void setActive(bool b) {
                    Active = b;
                }
                /** 
                 * toggles active state 
                 * returns the new state
                 */
                inline bool toggleActive() {
                    Active = (!Active);
                    return Active;
                }
                /** returns whether this job is active */
                inline bool isActive() {
                    return Active;
                }
                       
                
            protected:
                /** Renderable */
                WFX::renderer::Renderable* Renderable;
                /** Camera */
                WFX::renderer::Camera* Camera;
                /** Viewport */
                WFX::renderer::Viewport* Viewport;
                /** denotes whether this job is active */
                bool Active;
                
            
            private:

        };

    }

}


#endif //include guard


