]> git.tdb.fi Git - r2c2.git/blob - source/engineer/trainview.h
Complete rewrite of the engineer UI
[r2c2.git] / source / engineer / trainview.h
1 #ifndef TRAINVIEW_H_
2 #define TRAINVIEW_H_
3
4 #include <msp/gl/renderbuffer.h>
5 #include <msp/gl/framebuffer.h>
6 #include <msp/gl/texture2d.h>
7 #include <msp/gltk/dialog.h>
8 #include <msp/gltk/toggle.h>
9 #include "libr2c2/train.h"
10
11 class Engineer;
12
13 class TrainView: public Msp::GLtk::Dialog
14 {
15 public:
16         enum Mode
17         {
18                 ROOF,
19                 SIDE,
20                 HEAD
21         };
22
23 private:
24         Engineer &engineer;
25         const R2C2::Train &train;
26         Msp::GLtk::Toggle *tgl_forward;
27         Mode mode;
28         bool forward;
29         Msp::GL::Framebuffer fbo;
30         Msp::GL::Texture2D tex;
31         Msp::GL::Renderbuffer depth;
32         Msp::GL::Camera camera;
33         Msp::GL::Pipeline pipeline;
34
35 public:
36         TrainView(Engineer &, const R2C2::Train &);
37         ~TrainView();
38
39         void set_mode(Mode);
40 private:
41         void ui_mode_toggled(bool, Mode);
42 public:
43         void set_forward(bool);
44         void prepare();
45 };
46
47 #endif