me empecine con el makefile.... make stats :)
[seni.git] / engine / engine.hpp
blob53358a2c3d440697b40971dfc256c4e62f436657
1 /*SENI, Search for Extra Nibiru Intelligence*/
3 /*
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>.
19 Copyright SSW Team 2010
22 #ifndef __ENGINE__H_SENI
23 #define __ENGINE__H_SENI
25 #include <SDL/SDL.h>
27 #define ENGINE_NO_ERROR (0)
28 #define ENGINE_ERROR (ENGINE_NO_ERROR + 1)
30 #define MAX_EVENTS (6)
32 #define EVENT_QUIT (0)
33 #define EVENT_MOUSEMOTION (EVENT_QUIT + 1)
34 #define EVENT_MOUSEBUTTON (EVENT_QUIT + 2)
35 #define EVENT_KEYBOARD (EVENT_QUIT + 3)
36 #define EVENT_RESIZE (EVENT_QUIT + 4)
37 #define EVENT_DEFAULT (EVENT_QUIT + 5)
39 class Engine;
41 #include "menu.hpp"
43 typedef void (*engine_event)(SDL_Event *, Engine *);
44 typedef void (*quit_event)(void);
46 class Engine{
47 public:
48 Engine(void);
49 int initVideo(int, int, int, int);
50 void quit(void);
51 char *getError(void);
52 void setError(char *);
53 void setEvent(int, engine_event);
54 void setEventInAll(engine_event);
55 void setOnQuit(quit_event);
56 void startEvents(void);
57 void update(void);
58 void update(int, int, int, int);
59 int showMenu(Menu *);
60 int show(SDL_Surface *, int, int, int, int);
61 private:
62 char engineError[255];
63 engine_event events[MAX_EVENTS];
64 quit_event onquit;
65 SDL_Surface *screen;
66 Menu *menu;
69 #endif