Advanced Strategic Command
graphicsqueue.h
Go to the documentation of this file.
1 #ifndef graphicsqueueH
2 #define graphicsqueueH
3 
4 #include <list>
5 #include <SDL.h>
6 #include <sigc++/sigc++.h>
7 #include "loki/Functor.h"
8 #include "loki/Typelist.h"
9 
11  public:
12  virtual void execute() = 0;
14  };
15 
17  SDL_Surface *screen;
18  Sint32 x, y, w, h;
19  public:
20  UpdateRectOp( SDL_Surface *screen, Sint32 x, Sint32 y, Sint32 w, Sint32 h ) {
21  this->x = x;
22  this->y = y;
23  this->w = w;
24  this->h = h;
25  this->screen = screen;
26  };
27 
28  void execute();
29  };
30 
32  SDL_Surface *screen;
33  int numrects;
34  SDL_Rect *rects;
35  public:
36  UpdateRectsOp( SDL_Surface *screen, int numrects, SDL_Rect *rects);
37 
38  void execute();
40  };
41 
43  bool visible;
44  public:
45  MouseVisibility( bool visi ) : visible( visi ) { };
46  void execute() { SDL_ShowCursor(visible); };
47  };
48 
49 
50 
52  int x,y,depth,flags;
53  public:
54  typedef Loki::Functor<void, LOKI_TYPELIST_1(SDL_Surface*) > ScreenRegistrationFunctor;
55  private:
57  public:
58 
59  InitScreenOp( int x, int y, int depth, int flags, ScreenRegistrationFunctor screenRegistrationFunctor )
60  {
61  this->x = x;
62  this->y = y;
63  this->depth = depth;
64  this->flags = flags;
65  srf = screenRegistrationFunctor;
66  };
67  void execute();
68  };
69 
70  extern void queueOperation( GraphicsQueueOperation* gqo, bool wait = false, bool forceAsync = false );
71 
72  extern sigc::signal<void,const SDL_Surface*> postScreenUpdate;
73 
74 #endif
virtual void execute()=0
virtual ~GraphicsQueueOperation()
Definition: graphicsqueue.h:13
void wait(void)
Definition: events.cpp:195
UpdateRectOp(SDL_Surface *screen, Sint32 x, Sint32 y, Sint32 w, Sint32 h)
Definition: graphicsqueue.h:20
void execute()
Definition: events.cpp:461
sigc::signal< void, const SDL_Surface * > postScreenUpdate
Definition: events.cpp:392
InitScreenOp(int x, int y, int depth, int flags, ScreenRegistrationFunctor screenRegistrationFunctor)
Definition: graphicsqueue.h:59
UpdateRectsOp(SDL_Surface *screen, int numrects, SDL_Rect *rects)
Definition: events.cpp:434
void queueOperation(GraphicsQueueOperation *gqo, bool wait=false, bool forceAsync=false)
Definition: events.cpp:394
MouseVisibility(bool visi)
Definition: graphicsqueue.h:45
void execute()
Definition: events.cpp:448
void execute()
Definition: events.cpp:421
Loki::Functor< void, LOKI_TYPELIST_1(SDL_Surface *) > ScreenRegistrationFunctor
Definition: graphicsqueue.h:54