- dpy = new Graphics::Display;
-
- Graphics::WindowOptions wopt;
- wopt.width = screen_w;
- wopt.height = screen_h;
- wopt.fullscreen = fullscreen;
- wnd = new Graphics::Window(*dpy, wopt);
-
- Graphics::GLOptions glopt;
- //glopt.multisample = 4;
- glc = new Graphics::GLContext(*wnd, glopt);
-
- wnd->signal_close.connect(sigc::bind(sigc::mem_fun(this, &Engineer::exit), 0));
- wnd->signal_button_press.connect(sigc::mem_fun(this, &Engineer::button_press));
- wnd->signal_button_release.connect(sigc::mem_fun(this, &Engineer::button_release));
- wnd->signal_pointer_motion.connect(sigc::mem_fun(this, &Engineer::pointer_motion));
-
- 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);
-
- DataFile::load(ui_res, "marklin.res");
- root = new GLtk::Root(ui_res, *wnd);
- root->set_visible(true);
-
- list<GL::Texture *> texs = ui_res.get_list<GL::Texture>();
- for(list<GL::Texture *>::iterator i=texs.begin(); i!=texs.end(); ++i)
- {
- (*i)->set_min_filter(GL::NEAREST);
- (*i)->set_mag_filter(GL::NEAREST);
- }
-
- main_panel = new MainPanel(*this, ui_res);
- root->add(*main_panel);
- main_panel->set_position(0, screen_h-main_panel->get_geometry().h);
- main_panel->set_visible(true);