]> git.tdb.fi Git - r2c2.git/blobdiff - source/engineer/engineer.h
Emit various signals from Train when it's loaded
[r2c2.git] / source / engineer / engineer.h
index df45678306418c38e0ab9ffe905c89d567875d18..3e7a9109b7523ea6cba7b6dfb5a0d546048ef34e 100644 (file)
@@ -1,7 +1,7 @@
 /* $Id$
 
 This file is part of the MSP Märklin suite
-Copyright © 2006-2009 Mikkosoft Productions, Mikko Rasa
+Copyright © 2006-2010 Mikkosoft Productions, Mikko Rasa
 Distributed under the GPL
 */
 
@@ -9,8 +9,11 @@ Distributed under the GPL
 #define ENGINEER_H_
 
 #include <msp/core/application.h>
-#include <msp/gbase/glcontext.h>
-#include <msp/gl/font.h>
+#include <msp/gbase/simplewindow.h>
+#include <msp/gl/camera.h>
+#include <msp/gl/light.h>
+#include <msp/gl/lighting.h>
+#include <msp/gl/pipeline.h>
 #include <msp/gltk/resources.h>
 #include <msp/gltk/root.h>
 #include "libmarklin/catalogue.h"
@@ -19,6 +22,7 @@ Distributed under the GPL
 #include "libmarklin/trafficmanager.h"
 #include "libmarklin/train.h"
 #include "3d/layout.h"
+#include "3d/overlay.h"
 #include "network/server.h"
 
 class MainPanel;
@@ -28,12 +32,7 @@ class TrainProperties;
 class Engineer: public Msp::Application
 {
 private:
-       Msp::Graphics::Display *dpy;
-       Msp::Graphics::Window *wnd;
-       Msp::Graphics::GLContext *glc;
-       unsigned screen_w;
-       unsigned screen_h;
-       bool fullscreen;
+       Msp::Graphics::SimpleGLWindow *window;
        Msp::GLtk::Resources ui_res;
        Msp::GLtk::Root *root;
 
@@ -44,9 +43,14 @@ private:
        Marklin::TrafficManager *trfc_mgr;
        Marklin::Server *server;
        Msp::IO::EventDispatcher event_disp;
+       Marklin::Overlay3D *overlay;
+       std::list<Marklin::Train *> new_trains;
 
-       Marklin::Point cam_pos;
-       float cam_rot;
+       Msp::GL::Camera camera;
+       Msp::GL::Lighting lighting;
+       Msp::GL::Light light;
+       Msp::GL::Pipeline *pipeline;
+       Msp::GL::Mesh arrow_mesh;
 
        MainPanel *main_panel;
        std::list<TrainPanel *> train_panels;
@@ -54,7 +58,6 @@ private:
        Marklin::Block *placing_block;
        unsigned placing_entry;
 
-       bool no_lighting;
        bool simulate;
 
 public:
@@ -64,6 +67,7 @@ public:
        const Msp::GLtk::Resources &get_ui_resources() const { return ui_res; }
        Msp::GLtk::Root &get_root() const { return *root; }
        const Marklin::Catalogue &get_catalogue() const { return catalogue; }
+       const Marklin::Layout &get_layout() const { return layout; }
        Marklin::Control &get_control() { return control; }
        Marklin::TrafficManager &get_traffic_manager() { return *trfc_mgr; }
        void place_train(Marklin::Train &);
@@ -72,16 +76,15 @@ public:
 private:
        void tick();
        void button_press(int, int, unsigned, unsigned);
-       void button_release(int, int, unsigned, unsigned);
        void pointer_motion(int, int);
        void view_all();
        void set_block_color(const Marklin::Block &, const Msp::GL::Color &);
        void reset_block_color(const Marklin::Block &);
        void sensor_event(bool, Marklin::Sensor *);
        void block_reserved(const Marklin::Block &, const Marklin::Train *);
-       void project_3d();
        Marklin::Track3D *pick_track(int, int);
        void train_added(Marklin::Train &);
+       virtual void sighandler(int);
 
        static Msp::Application::RegApp<Engineer> reg;
 };