1 /**************************************************************************
2 * hud.c -- hud defines and prototypes
4 * Written by Michele America, started September 1997.
6 * Copyright (C) 1997 Michele F. America - nomimarketing@mail.telepac.pt
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of the
11 * License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 * (Log is kept at end of this file)
24 **************************************************************************/
30 # include <values.h> /* for MAXINT */
31 #endif /* not WIN32 */
34 #include <Include/fg_constants.h>
36 #include <Aircraft/aircraft.h>
37 #include <Scenery/mesh.h>
38 #include <Scenery/scenery.h>
39 #include <Math/mat3.h>
40 #include <Math/polar.h>
41 #include <Time/fg_timer.h>
42 #include <Math/fg_random.h>
43 #include <Weather/weather.h>
47 #define drawOneLine(x1,y1,x2,y2) glBegin(GL_LINES); \
48 glVertex2f ((x1),(y1)); glVertex2f ((x2),(y2)); glEnd();
50 /* textString - Bitmap font string */
52 static void textString(int x, int y, char *msg, void *font)
56 glutBitmapCharacter(font, *msg);
61 /* strokeString - Stroke font string */
63 static void strokeString(int x, int y, char *msg, void *font)
66 glTranslatef(x, y, 0);
67 glScalef(.04, .04, .04);
69 glutStrokeCharacter(font, *msg);
77 Draws a measuring scale anywhere on the HUD
80 Needs: HUD_scale struct
83 static void drawscale( int type, int sub_type, int min_value, int orientation, int scr_pos, \
84 int scr_min, int scr_max, double total_amount, int min_div, int max_div, \
88 int marker_x, marker_y;
90 // int scale_min, scale_max;
96 vmin = cur_value-total_amount/2;
97 vmax = cur_value+total_amount/2;
99 mid_scr = scr_min+(scr_max-scr_min)/2;
101 if( type == VERTICAL ) // Vertical scale
103 if( orientation == LEFT )
104 marker_x = scr_pos-6;
105 else if( orientation == RIGHT )
107 drawOneLine( scr_pos, scr_min, scr_pos, scr_max );
108 if( orientation == LEFT )
110 drawOneLine( scr_pos-3, scr_min, scr_pos, scr_min );
111 drawOneLine( scr_pos-3, scr_max, scr_pos, scr_max );
112 drawOneLine( scr_pos, mid_scr, scr_pos+6, mid_scr );
113 } else if( orientation == RIGHT )
115 drawOneLine( scr_pos, scr_min, scr_pos+3, scr_min );
116 drawOneLine( scr_pos, scr_max, scr_pos+3, scr_max );
117 drawOneLine( scr_pos, mid_scr, scr_pos-6, mid_scr );
120 factor = (scr_max-scr_min)/total_amount;
122 for( i=vmin; i<=vmax; i+=1 )
124 if( sub_type == LIMIT )
125 condition = i>= min_value;
126 else if( sub_type == NOLIMIT )
131 marker_y = scr_min+(i-vmin)*factor;
133 if( orientation == LEFT )
135 drawOneLine( marker_x+3, marker_y, marker_x+6, marker_y );
137 else if( orientation == RIGHT )
139 drawOneLine( marker_x, marker_y, marker_x+3, marker_y );
143 drawOneLine( marker_x, marker_y, marker_x+6, marker_y );
144 sprintf( TextScale, "%d", i );
145 if( orientation == LEFT )
147 textString( marker_x-8*strlen(TextScale)-2, marker_y-4, TextScale, GLUT_BITMAP_8_BY_13 );
149 else if( orientation == RIGHT )
151 textString( marker_x+10, marker_y-4, TextScale, GLUT_BITMAP_8_BY_13 );
157 if( type == HORIZONTAL ) // Horizontal scale
159 if( orientation == TOP )
161 else if( orientation == BOTTOM )
162 marker_y = scr_pos-6;
163 drawOneLine( scr_min, scr_pos, scr_max, scr_pos );
164 if( orientation == TOP )
166 drawOneLine( scr_min, scr_pos, scr_min, scr_pos-3 );
167 drawOneLine( scr_max, scr_pos, scr_max, scr_pos-3 );
168 drawOneLine( mid_scr, scr_pos, mid_scr, scr_pos-6 );
169 } else if( orientation == BOTTOM )
171 drawOneLine( scr_min, scr_pos, scr_min, scr_pos+3 );
172 drawOneLine( scr_max, scr_pos, scr_max, scr_pos+3 );
173 drawOneLine( mid_scr, scr_pos, mid_scr, scr_pos+6 );
176 factor = (scr_max-scr_min)/total_amount;
178 for( i=vmin; i<=vmax; i+=1 )
180 if( sub_type == LIMIT )
181 condition = i>= min_value;
182 else if( sub_type == NOLIMIT )
187 marker_x = scr_min+(i-vmin)*factor;
189 if( orientation == TOP )
191 drawOneLine( marker_x, marker_y, marker_x, marker_y+3 );
193 else if( orientation == BOTTOM )
195 drawOneLine( marker_x, marker_y+3, marker_x, marker_y+6 );
199 sprintf( TextScale, "%d", i );
200 if( orientation == TOP )
202 drawOneLine( marker_x, marker_y, marker_x, marker_y+6 );
203 textString( marker_x-4*strlen(TextScale), marker_y+14, TextScale, GLUT_BITMAP_8_BY_13 );
205 else if( orientation == BOTTOM )
207 drawOneLine( marker_x, marker_y, marker_x, marker_y+6 );
208 textString( marker_x+10, marker_y-4, TextScale, GLUT_BITMAP_8_BY_13 );
219 Draws a climb ladder in the center of the HUD
222 Needs: HUD_ladder struct
225 static void drawladder( struct HUD_ladder ladder )
228 double roll_value, pitch_value;
229 double cos_roll, sin_roll;
230 int marker_x, marker_y;
232 int scr_min, scr_max;
235 int new_x_ini, new_x_end;
236 int new_y_ini, new_y_end;
242 roll_value = (*ladder.load_roll)();
243 pitch_value = (*ladder.load_pitch)()*RAD_TO_DEG;
245 vmin = pitch_value-ladder.width_units/2;
246 vmax = pitch_value+ladder.width_units/2;
248 scr_min = ladder.y_pos-(ladder.scr_height/2);
249 scr_max = scr_min+ladder.scr_height;
251 mid_scr = scr_min+(scr_max-scr_min)/2;
253 marker_x = ladder.x_pos-ladder.scr_width/2;
255 factor = (scr_max-scr_min)/ladder.width_units;
257 for( i=vmin; i<=vmax; i+=1 )
262 marker_y = scr_min+(i-vmin)*factor;
263 if( i%ladder.div_units==0 )
265 sprintf( TextLadder, "%d", i );
266 if( ladder.scr_hole == 0 )
269 x_ini = ladder.x_pos-ladder.scr_width/2;
271 x_ini = ladder.x_pos-ladder.scr_width/2-10;
273 x_end = ladder.x_pos+ladder.scr_width/2;
275 new_x_ini = ladder.x_pos+(x_ini-ladder.x_pos)*cos(roll_value)-\
276 (y_ini-ladder.y_pos)*sin(roll_value);
277 new_y_ini = ladder.y_pos+(x_ini-ladder.x_pos)*sin(roll_value)+\
278 (y_ini-ladder.y_pos)*cos(roll_value);
279 new_x_end = ladder.x_pos+(x_end-ladder.x_pos)*cos(roll_value)-\
280 (y_end-ladder.y_pos)*sin(roll_value);
281 new_y_end = ladder.y_pos+(x_end-ladder.x_pos)*sin(roll_value)+\
282 (y_end-ladder.y_pos)*cos(roll_value);
286 drawOneLine( new_x_ini, new_y_ini, new_x_end, new_y_end );
290 glEnable(GL_LINE_STIPPLE);
291 glLineStipple( 1, 0x00FF );
292 drawOneLine( new_x_ini, new_y_ini, new_x_end, new_y_end );
293 glDisable(GL_LINE_STIPPLE);
295 textString( new_x_ini-8*strlen(TextLadder)-8, new_y_ini-4, TextLadder, GLUT_BITMAP_8_BY_13 );
296 textString( new_x_end+10, new_y_end-4, TextLadder, GLUT_BITMAP_8_BY_13 );
301 x_ini = ladder.x_pos-ladder.scr_width/2;
303 x_ini = ladder.x_pos-ladder.scr_width/2-10;
305 x_end = ladder.x_pos-ladder.scr_width/2+ladder.scr_hole/2;
307 new_x_ini = ladder.x_pos+(x_ini-ladder.x_pos)*cos(roll_value)-\
308 (y_ini-ladder.y_pos)*sin(roll_value);
309 new_y_ini = ladder.y_pos+(x_ini-ladder.x_pos)*sin(roll_value)+\
310 (y_ini-ladder.y_pos)*cos(roll_value);
311 new_x_end = ladder.x_pos+(x_end-ladder.x_pos)*cos(roll_value)-\
312 (y_end-ladder.y_pos)*sin(roll_value);
313 new_y_end = ladder.y_pos+(x_end-ladder.x_pos)*sin(roll_value)+\
314 (y_end-ladder.y_pos)*cos(roll_value);
318 drawOneLine( new_x_ini, new_y_ini, new_x_end, new_y_end );
322 glEnable(GL_LINE_STIPPLE);
323 glLineStipple( 1, 0x00FF );
324 drawOneLine( new_x_ini, new_y_ini, new_x_end, new_y_end );
325 glDisable(GL_LINE_STIPPLE);
327 textString( new_x_ini-8*strlen(TextLadder)-8, new_y_ini-4, TextLadder, GLUT_BITMAP_8_BY_13 );
329 x_ini = ladder.x_pos+ladder.scr_width/2-ladder.scr_hole/2;
332 x_end = ladder.x_pos+ladder.scr_width/2;
334 x_end = ladder.x_pos+ladder.scr_width/2+10;
336 new_x_ini = ladder.x_pos+(x_ini-ladder.x_pos)*cos(roll_value)-\
337 (y_ini-ladder.y_pos)*sin(roll_value);
338 new_y_ini = ladder.y_pos+(x_ini-ladder.x_pos)*sin(roll_value)+\
339 (y_ini-ladder.y_pos)*cos(roll_value);
340 new_x_end = ladder.x_pos+(x_end-ladder.x_pos)*cos(roll_value)-\
341 (y_end-ladder.y_pos)*sin(roll_value);
342 new_y_end = ladder.y_pos+(x_end-ladder.x_pos)*sin(roll_value)+\
343 (y_end-ladder.y_pos)*cos(roll_value);
347 drawOneLine( new_x_ini, new_y_ini, new_x_end, new_y_end );
351 glEnable(GL_LINE_STIPPLE);
352 glLineStipple( 1, 0x00FF );
353 drawOneLine( new_x_ini, new_y_ini, new_x_end, new_y_end );
354 glDisable(GL_LINE_STIPPLE);
356 textString( new_x_end+10, new_y_end-4, TextLadder, GLUT_BITMAP_8_BY_13 );
359 /* if( i%max_div==0 )
361 drawOneLine( marker_x, marker_y, marker_x+6, marker_y );
362 sprintf( TextScale, "%d", i );
363 if( orientation == LEFT )
365 textString( marker_x-8*strlen(TextScale)-2, marker_y-4, TextScale, GLUT_BITMAP_8_BY_13 );
367 else if( orientation == RIGHT )
369 textString( marker_x+10, marker_y-4, TextScale, GLUT_BITMAP_8_BY_13 );
379 Draws an artificial horizon line in the center of the HUD
380 (with or without a center hole)
382 Needs: x_center, y_center, length, hole
385 static void drawhorizon( struct HUD_horizon horizon )
390 double sin_bank, cos_bank;
393 // f = ¤t_aircraft.flight;
395 bank_angle = (*horizon.load_value)();
397 // sin_bank = sin( FG_2PI-FG_Phi );
398 // cos_bank = cos( FG_2PI-FG_Phi );
399 sin_bank = sin(FG_2PI-bank_angle);
400 cos_bank = cos(FG_2PI-bank_angle);
401 x_inc1 = (int)(horizon.scr_width*cos_bank);
402 y_inc1 = (int)(horizon.scr_width*sin_bank);
403 x_inc2 = (int)(horizon.scr_hole*cos_bank);
404 y_inc2 = (int)(horizon.scr_hole*sin_bank);
406 if( horizon.scr_hole == 0 )
408 drawOneLine( horizon.x_pos-x_inc1, horizon.y_pos-y_inc1, \
409 horizon.x_pos+x_inc1, horizon.y_pos+y_inc1 );
413 drawOneLine( horizon.x_pos-x_inc1, horizon.y_pos-y_inc1, \
414 horizon.x_pos-x_inc2, horizon.y_pos-y_inc2 );
415 drawOneLine( horizon.x_pos+x_inc2, horizon.y_pos+y_inc2, \
416 horizon.x_pos+x_inc1, horizon.y_pos+y_inc1 );
422 Draws a label anywhere in the HUD
424 Needs: HUD_label struct
427 static void drawlabel( struct HUD_label label )
434 if( label.pre_str != NULL && label.post_str != NULL )
435 sprintf( buffer, "%s%s%s", label.pre_str, label.format, label.post_str );
436 else if( label.pre_str == NULL && label.post_str != NULL )
437 sprintf( buffer, "%s%s", label.format, label.post_str );
438 else if( label.pre_str != NULL && label.post_str == NULL )
439 sprintf( buffer, "%s%s", label.pre_str, label.format );
441 sprintf( string, buffer, (*label.load_value)() );
444 fgPrintf( FG_COCKPIT, FG_DEBUG, buffer );
445 fgPrintf( FG_COCKPIT, FG_DEBUG, "\n" );
446 fgPrintf( FG_COCKPIT, FG_DEBUG, string );
447 fgPrintf( FG_COCKPIT, FG_DEBUG, "\n" );
450 lenstr = strlen( string );
451 if( label.justify == LEFT_JUST )
453 else if( label.justify == CENTER_JUST )
455 else if( label.justify == RIGHT_JUST )
458 if( label.size == SMALL )
459 textString( label.x_pos+posincr, label.y_pos, string, GLUT_BITMAP_8_BY_13);
460 else if( label.size == LARGE )
461 textString( label.x_pos+posincr, label.y_pos, string, GLUT_BITMAP_9_BY_15);
465 double get_speed( void )
469 f = ¤t_aircraft.flight;
470 return( FG_V_equiv_kts );
473 double get_aoa( void )
477 f = ¤t_aircraft.flight;
478 return( FG_Gamma_vert_rad*RAD_TO_DEG );
481 double get_roll( void )
485 f = ¤t_aircraft.flight;
489 double get_pitch( void )
493 f = ¤t_aircraft.flight;
497 double get_heading( void )
501 f = ¤t_aircraft.flight;
502 return( FG_Psi*RAD_TO_DEG );
505 double get_altitude( void )
508 /* double rough_elev; */
510 f = ¤t_aircraft.flight;
511 /* rough_elev = mesh_altitude(FG_Longitude * RAD_TO_ARCSEC,
512 FG_Latitude * RAD_TO_ARCSEC); */
514 return( FG_Altitude * FEET_TO_METER /* - rough_elev */ );
517 void add_instrument( Hptr hud, HIptr instrument )
521 instruments = hud->instruments;
522 // while( ++instruments
525 Hptr fgHUDInit( struct fgAIRCRAFT current_aircraft, int color )
529 hud = (Hptr)calloc(sizeof(struct HUD),1);
536 // For now lets just hardcode a hud here .
537 // In the future, hud information has to come from the same place
538 // aircraft information came
540 fgHUDAddHorizon( hud, 590, 50, 40, 20, get_roll );
541 fgHUDAddScale( hud, VERTICAL, 220, 100, 280, 5, 10, LEFT, LEFT, 0, 100, get_speed );
542 fgHUDAddScale( hud, VERTICAL, 440, 100, 280, 1, 5, RIGHT, RIGHT, -400, 25, get_aoa );
543 fgHUDAddScale( hud, HORIZONTAL, 280, 220, 440, 5, 10, TOP, TOP, 0, 50, get_heading );
544 fgHUDAddLabel( hud, 180, 85, SMALL, NOBLINK, RIGHT_JUST, NULL, " Kts", "%5.0f", get_speed );
545 fgHUDAddLabel( hud, 180, 73, SMALL, NOBLINK, RIGHT_JUST, NULL, " m", "%5.0f", get_altitude );
546 fgHUDAddLadder( hud, 330, 190, 90, 180, 70, 10, NONE, 45, get_roll, get_pitch );
551 Hptr fgHUDAddHorizon( Hptr hud, int x_pos, int y_pos, int length, \
552 int hole_len, double (*load_value)() )
554 struct HUD_horizon *horizon;
555 struct HUD_instr *instrument;
556 HIptr tmp_first, tmp_next;
558 tmp_first = hud->instruments;
559 if( tmp_first != NULL )
560 tmp_next = tmp_first->next;
564 instrument = (HIptr)calloc(sizeof(struct HUD_instr),1);
565 if( instrument == NULL )
568 horizon = (struct HUD_horizon *)calloc(sizeof(struct HUD_horizon),1);
569 if( horizon == NULL )
572 instrument->type = ARTIFICIAL_HORIZON;
573 instrument->instr.horizon = *horizon;
574 instrument->instr.horizon.x_pos = x_pos;
575 instrument->instr.horizon.y_pos = y_pos;
576 instrument->instr.horizon.scr_width = length;
577 instrument->instr.horizon.scr_hole = hole_len;
578 instrument->instr.horizon.load_value = load_value;
579 instrument->next = tmp_first;
581 hud->instruments = instrument;
586 Hptr fgHUDAddScale( Hptr hud, int type, int scr_pos, int scr_min, int scr_max, int div_min, int div_max, \
587 int orientation, int with_min, int min_value, int width_units, double (*load_value)() )
589 struct HUD_scale *scale;
590 struct HUD_instr *instrument;
591 HIptr tmp_first, tmp_next;
593 tmp_first = hud->instruments;
594 if( tmp_first != NULL )
595 tmp_next = tmp_first->next;
599 instrument = (HIptr)calloc(sizeof(struct HUD_instr),1);
600 if( instrument == NULL )
603 scale = (struct HUD_scale *)calloc(sizeof(struct HUD_scale),1);
607 instrument->type = SCALE;
608 instrument->instr.scale = *scale;
609 instrument->instr.scale.type = type;
610 instrument->instr.scale.scr_pos = scr_pos;
611 instrument->instr.scale.scr_min = scr_min;
612 instrument->instr.scale.scr_max = scr_max;
613 instrument->instr.scale.div_min = div_min;
614 instrument->instr.scale.div_max = div_max;
615 instrument->instr.scale.orientation = orientation;
616 instrument->instr.scale.with_minimum = with_min;
617 instrument->instr.scale.minimum_value = min_value;
618 instrument->instr.scale.width_units = width_units;
619 instrument->instr.scale.load_value = load_value;
620 instrument->next = tmp_first;
622 hud->instruments = instrument;
627 Hptr fgHUDAddLabel( Hptr hud, int x_pos, int y_pos, int size, int blink, int justify, \
628 char *pre_str, char *post_str, char *format, double (*load_value)() )
630 struct HUD_label *label;
631 struct HUD_instr *instrument;
632 HIptr tmp_first, tmp_next;
634 tmp_first = hud->instruments;
635 if( tmp_first != NULL )
636 tmp_next = tmp_first->next;
640 instrument = (HIptr)calloc(sizeof(struct HUD_instr),1);
641 if( instrument == NULL )
644 label = (struct HUD_label *)calloc(sizeof(struct HUD_label),1);
648 instrument->type = LABEL;
649 instrument->instr.label = *label;
650 instrument->instr.label.x_pos = x_pos;
651 instrument->instr.label.y_pos = y_pos;
652 instrument->instr.label.size = size;
653 instrument->instr.label.blink = blink;
654 instrument->instr.label.justify = justify;
655 instrument->instr.label.pre_str = pre_str;
656 instrument->instr.label.post_str = post_str;
657 instrument->instr.label.format = format;
658 instrument->instr.label.load_value = load_value;
659 instrument->next = tmp_first;
661 hud->instruments = instrument;
666 Hptr fgHUDAddLadder( Hptr hud, int x_pos, int y_pos, int scr_width, int scr_height, \
667 int hole_len, int div_units, int label_pos, int width_units, \
668 double (*load_roll)(), double (*load_pitch)() )
670 struct HUD_ladder *ladder;
671 struct HUD_instr *instrument;
672 HIptr tmp_first, tmp_next;
674 tmp_first = hud->instruments;
675 if( tmp_first != NULL )
676 tmp_next = tmp_first->next;
680 instrument = (HIptr)calloc(sizeof(struct HUD_instr),1);
681 if( instrument == NULL )
684 ladder = (struct HUD_ladder *)calloc(sizeof(struct HUD_ladder),1);
688 instrument->type = LADDER;
689 instrument->instr.ladder = *ladder;
690 instrument->instr.ladder.type = 0; // Not used.
691 instrument->instr.ladder.x_pos = x_pos;
692 instrument->instr.ladder.y_pos = y_pos;
693 instrument->instr.ladder.scr_width = scr_width;
694 instrument->instr.ladder.scr_height = scr_height;
695 instrument->instr.ladder.scr_hole = hole_len;
696 instrument->instr.ladder.div_units = div_units;
697 instrument->instr.ladder.label_position = label_pos;
698 instrument->instr.ladder.width_units = width_units;
699 instrument->instr.ladder.load_roll = load_roll;
700 instrument->instr.ladder.load_pitch = load_pitch;
701 instrument->next = tmp_first;
703 hud->instruments = instrument;
709 Hptr fgHUDAddMovingHorizon( Hptr hud, int x_pos, int y_pos, int length, int hole_len, \
715 Hptr fgHUDAddCircularLadder( Hptr hud, int scr_min, int scr_max, int div_min, int div_max, \
721 Hptr fgHUDAddNumDisp( Hptr hud, int x_pos, int y_pos, int size, int color, int blink, \
722 char *pre_str, char *post_str )
728 void fgUpdateHUD( Hptr hud )
731 union HUD_instr_data instr_data;
733 glMatrixMode(GL_PROJECTION);
737 gluOrtho2D(0, 640, 0, 480);
738 glMatrixMode(GL_MODELVIEW);
742 glColor3f(1.0, 1.0, 1.0);
745 glDisable(GL_DEPTH_TEST);
746 glDisable(GL_LIGHTING);
749 glColor3f (0.1, 0.9, 0.1);
752 fgPrintf( FG_COCKPIT, FG_DEBUG, "HUD Code %d Status %d\n",
753 hud->code, hud->status );
755 hud_instr = hud->instruments;
756 while( hud_instr != NULL )
758 instr_data = hud_instr->instr;
760 fgPrintf( FG_COCKPIT, FG_DEBUG,
761 "Instr Type %d SubType %d Orient %d\n",
762 hud_instr->type, hud_instr->sub_type, hud_instr->orientation );
764 if( hud_instr->type == ARTIFICIAL_HORIZON )
766 drawhorizon( instr_data.horizon );
767 /* drawhorizon( instr_data.horizon.x_pos, instr_data.horizon.y_pos, \
768 instr_data.horizon.scr_width, instr_data.horizon.scr_hole ); */
770 else if( hud_instr->type == SCALE )
772 drawscale( instr_data.scale.type, instr_data.scale.with_minimum, \
773 instr_data.scale.minimum_value, instr_data.scale.orientation, \
774 instr_data.scale.scr_pos, instr_data.scale.scr_min, \
775 instr_data.scale.scr_max, instr_data.scale.width_units, \
776 instr_data.scale.div_min, instr_data.scale.div_max, \
777 (*instr_data.scale.load_value)() );
779 else if( hud_instr->type == LABEL )
781 drawlabel( instr_data.label );
782 /* drawlabel( instr_data.label.x_pos, instr_data.label.y_pos, instr_data.label.size, \
783 instr_data.label.blink, instr_data.label.pre_str, instr_data.label.post_str, \
784 instr_data.label.format, (*instr_data.label.load_value)() ); */
786 else if( hud_instr->type == LADDER )
788 drawladder( instr_data.ladder );
790 hud_instr = hud_instr->next;
794 glEnable(GL_DEPTH_TEST);
795 glEnable(GL_LIGHTING);
796 glMatrixMode(GL_PROJECTION);
798 glMatrixMode(GL_MODELVIEW);
805 /* Revision 1.8 1998/01/27 00:47:51 curt
806 /* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
807 /* system and commandline/config file processing code.
809 * Revision 1.7 1998/01/19 18:40:20 curt
810 * Tons of little changes to clean up the code and to remove fatal errors
811 * when building with the c++ compiler.
813 * Revision 1.6 1997/12/15 23:54:34 curt
814 * Add xgl wrappers for debugging.
815 * Generate terrain normals on the fly.
817 * Revision 1.5 1997/12/10 22:37:39 curt
818 * Prepended "fg" on the name of all global structures that didn't have it yet.
819 * i.e. "struct WEATHER {}" became "struct fgWEATHER {}"
821 * Revision 1.4 1997/09/23 00:29:32 curt
822 * Tweaks to get things to compile with gcc-win32.
824 * Revision 1.3 1997/09/05 14:17:26 curt
825 * More tweaking with stars.
827 * Revision 1.2 1997/09/04 02:17:30 curt
830 * Revision 1.1 1997/08/29 18:03:22 curt