
#ifndef __WFX_SDL_SDLRENDERWINDOW_H__
#define __WFX_SDL_SDLRENDERWINDOW_H__

#include <WFX/WFXIncludes.h>

#include <SDL/SDL.h>
#include <WFX/renderer/RenderWindow.h>

namespace WFX {

    namespace SDL {

        /**
         * SDL implementation of a RenderWindow
         */
        class SDLRenderWindow : public WFX::renderer::RenderWindow {
            public:
                /**
                 * Ctor
                 * @see RenderWindow
                 * initialises SDL Video subsystem
                 *
                 * @throws: a colorful variety of exceptions
                 */
                SDLRenderWindow(Int w, Int h, Int d, std::string title, bool fs);
                /**
                 * Dtor
                 * shuts down the SDL video subsystem if necesarry
                 */
                ~SDLRenderWindow();

                /** RenderTarget::setClearColor */
                void setClearColor(const WFX::scene::Color& c);
                /** RenderTarget::clear() */
                void clear();
                /** RenderTarget::swapBuffers */
                void swapBuffers();
                /** RenderTarget::saveToFile */
                void saveToFile(const WFX::io::File& f);
                
                /**
                 * resizes this window
                 * @see: RenderWindow::resize
                 */
                void resize(Int w, Int h);

                /**
                 * sets the window title
                 * @see: RenderWindow::setTitle
                 */
                void setTitle(std::string title);

                /**
                 * toggles fullscreen mode
                 */
                void toggleFullscreen();

                /** show/hide mouse cursor */
                void hideCursor();
                void showCursor();
                /** warp cursor */
                void warpCursor(UInt x, UInt y);
                void centerCursor();


            protected:
                /** instance counter */
                static Int Instances;

                /** the screen */
                SDL_Surface* Screen;

            private:

        };

    }

}


#endif //include guard


