X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=platform%2Fsdlv.h;h=4258623b279528a585cffe0c095623a17cd6e187;hb=4486e487785be514761017cde58a65e67f26ca9b;hp=b713ea0a9db8873ae11529e699e35b470de484f1;hpb=24cb730f82bbe2b4873e8b59a214c2b1f27d10b3;p=drnoksnes diff --git a/platform/sdlv.h b/platform/sdlv.h index b713ea0..4258623 100644 --- a/platform/sdlv.h +++ b/platform/sdlv.h @@ -3,6 +3,51 @@ #include +class Scaler +{ +public: + Scaler() { }; + virtual ~Scaler() { }; + + virtual const char * getName() const = 0; + + virtual uint8* getDrawBuffer() const = 0; + virtual unsigned int getDrawBufferPitch() const = 0; + virtual void getRenderedGUIArea(unsigned short& x, unsigned short& y, + unsigned short& w, unsigned short& h) + const = 0; + virtual void getRatio(float& x, float& y) const = 0; + + virtual void prepare() = 0; + virtual void finish() = 0; + virtual void pause() = 0; + virtual void resume() = 0; + virtual bool filter(const SDL_Event& event) = 0; +}; + +class ScalerFactory +{ +public: + ScalerFactory() { }; + virtual ~ScalerFactory() { }; + virtual const char * getName() const = 0; + virtual bool canEnable(int bpp, int w, int h) const = 0; + virtual Scaler* instantiate(SDL_Surface* screen, int w, int h) const = 0; +}; + +const ScalerFactory* searchForScaler(int bpp, int w, int h); + +/** SDL screen */ extern SDL_Surface* screen; +/** The current scaler object */ +extern Scaler* scaler; + +bool videoEventFilter(const SDL_Event& event); + +#if CONF_EXIT_BUTTON +void ExitBtnReset(); +bool ExitBtnRequiresDraw(); +void ExitBtnDraw(SDL_Surface* where); +#endif #endif