- SDL_Init(SDL_INIT_VIDEO);
- SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
- SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, 4);
- SDL_Surface *screen=SDL_SetVideoMode(screen_w, screen_h, 32, SDL_OPENGL|(fullscreen?SDL_FULLSCREEN:0));
- if(!screen)
- {
- SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, 0);
- screen=SDL_SetVideoMode(screen_w, screen_h, 32, SDL_OPENGL|(fullscreen?SDL_FULLSCREEN:0));
- }
- if(!screen)
- {
- SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 0);
- screen=SDL_SetVideoMode(screen_w, screen_h, 32, SDL_OPENGL|(fullscreen?SDL_FULLSCREEN:0));
- }
- if(!screen)
- throw Exception("Couldn't create window");
-
- glEnableClientState(GL_VERTEX_ARRAY);
- glColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE);
- glEnable(GL_COLOR_MATERIAL);
- glDepthFunc(GL_LEQUAL);
- glEnable(GL_BLEND);
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-
- Parser::load(ui_res, "engineer.res");
- main_panel=new MainPanel(*this, ui_res);
- main_panel->set_position(0, screen_h-main_panel->get_geometry().h);
-
- Application::main();
-
- delete main_panel;
- for(TrainPanelSeq::iterator i=train_panels.begin(); i!=train_panels.end(); ++i)
- delete *i;