original 1.0.1 release
[xwelltris.git] / src / sdl / sdlwellengine.h
blob9a21d65caa732a28e73e7e6fe35348fa690bf149
1 #ifndef SDLWELLENGINE_H
2 #define SDLWELLENGINE_H
4 #include "globals.h"
5 #include "welltris.h"
7 #include "SDL.h"
9 #include "wellengine.h"
11 class SDLWellEngine:public WellEngine
13 protected:
14 SDL_Surface *mainw;
15 SDL_Surface *pics[MAX_IMAGES];
16 Uint32 game_colors[MAX_GAME_COLORS];
17 Uint8 game_RGBA[MAX_GAME_COLORS*4];
18 SDL_Surface *bg_image;
20 SDL_Event key_event;
21 bool key_event_got;
22 int key_ticks;
24 virtual void init_mainwindow(int,char**);
25 virtual int wait_for_timers();
27 virtual void init_colors();
28 void set_key_event(SDL_Event&);
29 void reset_key_event();
30 void process_key_event();
32 public:
33 SDLWellEngine(int argc,char** argv);
34 ~SDLWellEngine();
35 virtual void show_main();
36 virtual void event_loop();
37 virtual bool load_image(Images id, char* name);
38 virtual void set_main_background_image(Images id);
39 virtual WellImageFont* new_well_image_font(Images id,
40 unsigned int ifl,
41 unsigned int ifh,
42 int idx, int idy);
43 virtual WellInput* new_well_input(char*);
44 virtual WellDrawingEngine* new_well_drawing_engine();
46 SDL_Surface* get_pixmap_of_image(Images id) { return pics[id];};
47 SDL_Surface* get_main_window() { return mainw;};
48 Uint32* get_colors() { return game_colors;};
49 Uint8* get_RGBA() { return game_RGBA;};
51 virtual void udelay(int msec);
52 virtual void screen_copy(Geo*);
53 virtual void screen_clear(Geo*);
56 #endif