]> git.localhorst.tv Git - l2e.git/blob - src/main.cpp
added empty battle state
[l2e.git] / src / main.cpp
1 /*
2  * main.cpp
3  *
4  *  Created on: Aug 1, 2012
5  *      Author: holy
6  */
7
8 #include "app/Application.h"
9 #include "battle/BattleState.h"
10 #include "sdl/InitScreen.h"
11 #include "sdl/InitSDL.h"
12
13 #include <exception>
14 #include <iostream>
15
16 using app::Application;
17 using battle::BattleState;
18 using sdl::InitScreen;
19 using sdl::InitSDL;
20
21 using std::cerr;
22 using std::cout;
23 using std::endl;
24 using std::exception;
25
26 int main(int argc, char **argv) {
27         const int width = 800;
28         const int height = 480;
29
30         // temporary
31         SDL_Surface *bg(SDL_CreateRGBSurface(0, width, height, 32, 0xFF000000, 0xFF0000, 0xFF00, 0xFF));
32         SDL_FillRect(bg, 0, SDL_MapRGB(bg->format, 0, 0, 0));
33
34         try {
35                 InitSDL sdl;
36                 InitScreen screen(width, height);
37
38                 Application app(screen.Screen(), new BattleState(bg));
39                 app.Run();
40
41                 return 0;
42         } catch (exception &e) {
43                 cerr << "exception in main(): " << e.what() << endl;
44                 return 1;
45         }
46 }