
#ifndef __WFX_LANG_WFXGUIAPPLICATION_H__
#define __WFX_LANG_WFXGUIAPPLICATION_H__

#include <WFX/WFXIncludes.h>
#include <WFX/lang/WFXApplication.h>
#include <WFX/kernel/Kernel.h>
#include <WFX/kernel/TimeTask.h>
#include <WFX/kernel/Task.h>
#include <WFX/input/KeyboardListener.h>
#include <WFX/input/InputHandler.h>
#include <WFX/renderer/RenderWindow.h>
#include <WFX/renderer/Renderer.h>
#include <WFX/scene/MaterialManager.h>

namespace WFX {

    namespace lang {
        
        /**
         * WFXGUIApplication class
         * 
         *  
         */
        class WFXGUIApplication: public WFXApplication,
                                 public WFX::kernel::Task,
                                 public WFX::input::KeyboardListener {
            public:
                /**
                 * CTor
                 */
                WFXGUIApplication(int argc, char *argv[]);
                WFXGUIApplication();
               
                /**
                 * initialize the application
                 * creates a RenderWindow, InputHandler 
                 * adds application to kernel
                 */
                void setup(Int ww, Int wh, Int wd, std::string wt);
                
                virtual ~WFXGUIApplication();

            protected:
                /** the Kernel */
                WFX::kernel::Kernel* Kernel;
                /** the TimeTask */
                WFX::kernel::TimeTask* TimeTask;
                /** TextureManager */
                WFX::scene::TextureManager* TextureManager;
                /** MaterialManager */
                WFX::scene::MaterialManager* MaterialManager;
                /** Pointer to the RenderWindow */
                WFX::renderer::RenderWindow* Window;
                /** InputHandler */
                WFX::input::InputHandler* InputHandler;
                /** Renderer */
                WFX::renderer::Renderer* Renderer;
                /** ScreenShot base */
                std::string ScreenShotBase;
                /** ScreenShot extension */
                std::string ScreenShotExt;
                
                
                /** starts the Application */
                void run();

                /** exits the program */
                void exit();

                /** takes a screenshot */
                void saveScreenShot();

                /** implement task interface */
                virtual bool start() { return false; };
                virtual void stop() {};
                virtual void update() {};
                /** implement KeyboardListener */
                virtual void keyPressed(WFX::input::KeyEvent k) {};
                virtual void keyReleased(WFX::input::KeyEvent k) {};
                
            private:
                /**
                 * private method called by constructors
                 */
                void init();
        };

    }
    
}

#endif //include guard

