1 // panel.hxx -- instrument panel defines and prototypes
3 // Written by Friedemann Reinhard, started June 1998.
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License as
7 // published by the Free Software Foundation; either version 2 of the
8 // License, or (at your option) any later version.
10 // This program is distributed in the hope that it will be useful, but
11 // WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 // General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 // (Log is kept at end of this file)
22 #define LETTER_OFFSET 0.03515625
29 # error This library requires C++
54 // FGInstrument **instr_list;
55 FGInstrument *test_instr[7];
60 static FGPanel *OurPanel;
64 float get_height(void){
68 void ReInit( int x, int y, int finx, int finy);
71 void DrawLetter(void){
73 glTexCoord2f(0.0, 0.0);
75 glTexCoord2f(LETTER_OFFSET + 0.004, 0.0);
77 glTexCoord2f(LETTER_OFFSET + 0.004, 0.0390625);
79 glTexCoord2f(0.0, 0.0390625);
84 void DrawTestLetter(float X, float Y);
86 void TexString(char *s, float XPos, float YPos, float size);
100 virtual ~FGInstrument(void){}
102 virtual void Init(void) = 0;
103 virtual void Render(void) = 0;
106 class FGHorizon : public FGInstrument {
111 float bottom; // tell the program the offset between midpoint and bottom
112 float top; // guess what ;-)
113 float vertices[180][2];
114 float normals[180][3];
115 float texCoord[180][2];
119 XPos = 0.0; YPos = 0.0;
123 FGHorizon(float inXPos, float inYPos){
124 XPos = inXPos; YPos = inYPos;
128 virtual void Init(void);
129 virtual void Render(void);
133 class FGTurnCoordinator : public FGInstrument {
146 GLfloat vertices[72];
149 FGTurnCoordinator(void){
150 XPos = 0.0; YPos = 0.0;
154 FGTurnCoordinator(float inXPos, float inYPos){
155 XPos = inXPos; YPos = inYPos;
159 virtual void Init (void);
160 virtual void Render(void);
164 class FGRpmGauge : public FGInstrument {
170 XPos = 0.0; YPos = 0.0;
174 FGRpmGauge(float inXPos, float inYPos){
175 XPos = inXPos; YPos = inYPos;
179 virtual void Init(void);
180 virtual void Render(void);
183 // temporary class until I get the software-only routines for the
186 class FGTexInstrument : public FGInstrument {
201 GLfloat vertices[20];
204 FGTexInstrument(void){
205 XPos = 0.0; YPos = 0.0;
209 FGTexInstrument(float inXPos, float inYPos, float inradius, float inlength, float inwidth, float inangle, float invalue1, float invalue2, float inalpha1, float inalpha2, float intexXPos, float intexYPos, int invariable){
211 XPos = inXPos; YPos = inYPos;
212 radius = inradius; angle = inangle;
213 length = inlength; width = inwidth;
214 value1 = invalue1; value2 = invalue2;
215 alpha1 = inalpha1; alpha2 = inalpha2;
216 teXpos = intexXPos; texYpos = intexYPos;
217 variable = invariable;
221 void CreatePointer(void);
222 void UpdatePointer(void);
243 GLfloat vertices[20];
246 void fgEraseArea(GLfloat *array, int NumVerti, GLfloat texXPos, GLfloat texYPos, GLfloat XPos, GLfloat YPos, int Texid, float ScaleFactor);
247 void DrawScale(float XPos, float YPos, float InnerRadius, float OuterRadius, float alpha1, float alpha2, int steps, float LineWidth, float red, float green, float blue, bool filled);
248 void DrawBeechcraftLogo(float XPos, float YPos, float Width, float Height);
250 void PrintMatrix( void);
257 // Revision 1.9 1999/03/09 20:58:18 curt
258 // Tweaks for compiling under native Irix compilers.
260 // Revision 1.8 1999/03/08 21:56:10 curt
261 // Added panel changes sent in by Friedemann.
263 // Revision 1.5 1999/01/07 19:25:55 curt
264 // Updates from Friedemann Reinhard.
266 // Revision 1.4 1998/11/11 00:19:29 curt
267 // Updated comment delimeter to C++ style.
269 // Revision 1.3 1998/11/09 23:38:54 curt
270 // Panel updates from Friedemann.
272 // Revision 1.2 1998/08/28 18:14:41 curt
273 // Added new cockpit code from Friedemann Reinhard
274 // <mpt218@faupt212.physik.uni-erlangen.de>
276 // Revision 1.1 1998/06/27 16:47:55 curt
277 // Incorporated Friedemann Reinhard's <mpt218@faupt212.physik.uni-erlangen.de>
278 // first pass at an isntrument panel.