]> git.mxchange.org Git - flightgear.git/blob - src/GUI/gui_local.cxx
Sync with latest JSBSim CVS
[flightgear.git] / src / GUI / gui_local.cxx
1 #ifdef HAVE_CONFIG_H
2 #  include <config.h>
3 #endif
4
5 #ifdef HAVE_WINDOWS_H
6 #  include <windows.h>
7 #endif
8
9 #include <GL/glut.h>            // needed before pu.h
10 #include <plib/pu.h>            // plib include
11
12 #include <Main/globals.hxx>
13 #include <Main/fg_init.hxx>
14 #include <Main/fg_props.hxx>
15
16 #include "gui.h"
17 #include "trackball.h"
18
19 // from main.cxx
20 extern void fgReshape(int, int);
21
22 // FOR MOUSE VIEW MODE
23 // stashed trackball(_quat0, 0.0, 0.0, 0.0, 0.0);
24 static float _quat0[4];
25
26 float lastGuiQuat[4];
27 float curGuiQuat[4];
28
29 // To apply our mouse rotation quat to VIEW
30 // sgPreMultMat4( VIEW, GuiQuat_mat);
31 // This is here temporarily should be in views.hxx
32 float GuiQuat_mat[4][4];
33
34 void Quat0( void ) {
35         curGuiQuat[0] = _quat0[0];
36         curGuiQuat[1] = _quat0[1];
37         curGuiQuat[2] = _quat0[2];
38         curGuiQuat[3] = _quat0[3];
39 }
40
41 void initMouseQuat(void) {
42         trackball(_quat0, 0.0, 0.0, 0.0, 0.0);  
43         Quat0();
44         build_rotmatrix(GuiQuat_mat, curGuiQuat);
45 }
46
47
48 void reInit(puObject *cb)
49 {
50         BusyCursor(0);
51         Quat0();
52
53         // in case user has changed window size as
54         // restoreInitialState() overwrites these
55         int xsize = fgGetInt("/sim/startup/xsize");
56         int ysize = fgGetInt("/sim/startup/ysize");
57
58         build_rotmatrix(GuiQuat_mat, curGuiQuat);
59         /* check */ globals->restoreInitialState();
60
61         fgReInitSubsystems();
62
63         fgReshape( xsize, ysize );
64
65         BusyCursor(1);
66 }
67