]> git.tdb.fi Git - r2c2.git/blob - source/engineer/trainview.h
Add a common base class for dialogs that need to update dynamically
[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/toggle.h>
8 #include "libr2c2/train.h"
9 #include "dynamicdialog.h"
10
11 class TrainView: public DynamicDialog
12 {
13 public:
14         enum Mode
15         {
16                 ROOF,
17                 SIDE,
18                 HEAD
19         };
20
21 private:
22         const R2C2::Train &train;
23         Msp::GLtk::Toggle *tgl_forward;
24         Mode mode;
25         bool forward;
26         Msp::GL::Framebuffer fbo;
27         Msp::GL::Texture2D tex;
28         Msp::GL::Renderbuffer depth;
29         R2C2::View3D view;
30
31 public:
32         TrainView(Engineer &, const R2C2::Train &);
33
34         void set_mode(Mode);
35 private:
36         void ui_mode_toggled(bool, Mode);
37 public:
38         void set_forward(bool);
39         virtual void update();
40 };
41
42 #endif