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.
21 #define LETTER_OFFSET 0.03515625
28 # error This library requires C++
53 // FGInstrument **instr_list;
54 FGInstrument *test_instr[7];
59 static FGPanel *OurPanel;
63 float get_height(void){
67 void ReInit( int x, int y, int finx, int finy);
70 void DrawLetter(void){
72 glTexCoord2f(0.0, 0.0);
74 glTexCoord2f(LETTER_OFFSET + 0.004, 0.0);
76 glTexCoord2f(LETTER_OFFSET + 0.004, 0.0390625);
78 glTexCoord2f(0.0, 0.0390625);
83 void DrawTestLetter(float X, float Y);
85 void TexString(char *s, float XPos, float YPos, float size);
99 virtual ~FGInstrument(void){}
101 virtual void Init(void) = 0;
102 virtual void Render(void) = 0;
105 class FGHorizon : public FGInstrument {
110 float bottom; // tell the program the offset between midpoint and bottom
111 float top; // guess what ;-)
112 float vertices[180][2];
113 float normals[180][3];
114 float texCoord[180][2];
118 XPos = 0.0; YPos = 0.0;
122 FGHorizon(float inXPos, float inYPos){
123 XPos = inXPos; YPos = inYPos;
127 virtual void Init(void);
128 virtual void Render(void);
132 class FGTurnCoordinator : public FGInstrument {
145 GLfloat vertices[72];
148 FGTurnCoordinator(void){
149 XPos = 0.0; YPos = 0.0;
153 FGTurnCoordinator(float inXPos, float inYPos){
154 XPos = inXPos; YPos = inYPos;
158 virtual void Init (void);
159 virtual void Render(void);
163 class FGRpmGauge : public FGInstrument {
169 XPos = 0.0; YPos = 0.0;
173 FGRpmGauge(float inXPos, float inYPos){
174 XPos = inXPos; YPos = inYPos;
178 virtual void Init(void);
179 virtual void Render(void);
182 // temporary class until I get the software-only routines for the
185 class FGTexInstrument : public FGInstrument {
200 GLfloat vertices[20];
203 FGTexInstrument(void){
204 XPos = 0.0; YPos = 0.0;
208 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){
210 XPos = inXPos; YPos = inYPos;
211 radius = inradius; angle = inangle;
212 length = inlength; width = inwidth;
213 value1 = invalue1; value2 = invalue2;
214 alpha1 = inalpha1; alpha2 = inalpha2;
215 teXpos = intexXPos; texYpos = intexYPos;
216 variable = invariable;
220 void CreatePointer(void);
221 void UpdatePointer(void);
242 GLfloat vertices[20];
245 void fgEraseArea(GLfloat *array, int NumVerti, GLfloat texXPos, GLfloat texYPos, GLfloat XPos, GLfloat YPos, int Texid, float ScaleFactor);
246 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);
247 void DrawBeechcraftLogo(float XPos, float YPos, float Width, float Height);
249 void PrintMatrix( void);