original 1.0.1 release
[xwelltris.git] / src / sdl / sdlwelldrawing.h
blob6ab15fb34a6e174c570627d6e3068a2ad29603aa
1 // docm_prefix(///)
2 #ifndef SDLWELLDRAWING_H
3 #define SDLWELLDRAWING_H
5 #include "globals.h"
6 #include "SDL.h"
7 #include "welldrawing.h"
9 class SDLWellEngine;
11 struct SDLPoint
13 int x,y;
16 /// module description
17 /// Definition of the SDLWellDrawingEngine class,
18 /// public child from WellDrawingEngine -> engine for drawing game field
19 class SDLWellDrawingEngine:public WellDrawingEngine
21 protected:
22 SDLWellEngine *engine;
23 SDL_Surface **fields;
24 SDL_Surface *mainw;
25 Uint32 *colors;
26 Uint8 *RGBA;
27 Uint32 bg_color, fg_color;
29 Sint16 trap_x[MAX_SIDES];
30 Sint16 trap_y[MAX_SIDES];
32 void flush_field(SDL_Surface* win, int ix, int iy, int il, int ih);
35 public:
36 SDLWellDrawingEngine(SDLWellEngine* myengine);
37 virtual void init(int,int,int,unsigned int,unsigned int);
38 virtual void flush_all();
39 virtual void flush_dirty();
40 virtual void field_sync();
41 virtual void draw_grid();
42 virtual void draw_square(int color, int i, int j);
43 virtual void draw_trapazoid(int color, int i, int j);
44 virtual void sync();
45 virtual void clear_field(int i);
46 virtual Actions key_to_action(void* event);
47 virtual void draw_line(int x1, int y1, int x2, int y2, int color_idx,
48 Canvas where=screen);
49 virtual void draw_rect(int x1, int y1, unsigned int il,
50 unsigned int ih, int color_idx,
51 Canvas where=screen);
52 virtual void fill_rect(int x1, int y1, unsigned int il,
53 unsigned int ih, int color_idx,
54 Canvas where=screen);
55 virtual void pixmap_copy(Geo *pgeo);
58 #endif