workaround a problem with the harmattan gcc
[drnoksnes] / platform / sdlv.h
1 #ifndef _PLATFORM_SDLV_H_
2 #define _PLATFORM_SDLV_H_
3
4 #include <SDL.h>
5
6 class Scaler
7 {
8 public:
9         Scaler() { };
10         virtual ~Scaler() { };
11
12         virtual const char * getName() const = 0;
13
14         virtual uint8* getDrawBuffer() const = 0;
15         virtual unsigned int getDrawBufferPitch() const = 0;
16         virtual void getRenderedGUIArea(unsigned short& x, unsigned short& y,
17                                                                         unsigned short& w, unsigned short& h)
18                                                                         const = 0;
19         virtual void getRatio(float& x, float& y) const = 0;
20
21         virtual void prepare() = 0;
22         virtual void finish() = 0;
23         virtual void pause() = 0;
24         virtual void resume() = 0;
25         virtual bool filter(const SDL_Event& event) = 0;
26 };
27
28 class ScalerFactory
29 {
30 public:
31         ScalerFactory() { };
32         virtual ~ScalerFactory() { };
33         virtual const char * getName() const = 0;
34         virtual bool canEnable(int bpp, int w, int h) const = 0;
35         virtual Scaler* instantiate(SDL_Surface* screen, int w, int h) const = 0;
36 };
37
38 const ScalerFactory* searchForScaler(int bpp, int w, int h);
39
40 /** SDL screen */
41 extern SDL_Surface* screen;
42 /** The current scaler object */
43 extern Scaler* scaler;
44
45 bool videoEventFilter(const SDL_Event& event);
46
47 #if CONF_EXIT_BUTTON
48 void ExitBtnReset();
49 bool ExitBtnRequiresDraw();
50 void ExitBtnDraw(SDL_Surface* where);
51 #endif
52
53 #endif