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 */
62 /* static void strokeString(int x, int y, char *msg, void *font) */
65 /* glTranslatef(x, y, 0); */
66 /* glScalef(.04, .04, .04); */
68 /* glutStrokeCharacter(font, *msg); */
76 Draws a measuring scale anywhere on the HUD
79 Needs: HUD_scale struct
82 static void drawscale( int type, int sub_type, int min_value, int orientation, int scr_pos, \
83 int scr_min, int scr_max, double total_amount, int min_div, int max_div, \
87 int marker_x, marker_y;
89 // int scale_min, scale_max;
95 vmin = cur_value-total_amount/2;
96 vmax = cur_value+total_amount/2;
98 mid_scr = scr_min+(scr_max-scr_min)/2;
100 if( type == VERTICAL ) // Vertical scale
102 if( orientation == LEFT )
103 marker_x = scr_pos-6;
104 else if( orientation == RIGHT )
106 drawOneLine( scr_pos, scr_min, scr_pos, scr_max );
107 if( orientation == LEFT )
109 drawOneLine( scr_pos-3, scr_min, scr_pos, scr_min );
110 drawOneLine( scr_pos-3, scr_max, scr_pos, scr_max );
111 drawOneLine( scr_pos, mid_scr, scr_pos+6, mid_scr );
112 } else if( orientation == RIGHT )
114 drawOneLine( scr_pos, scr_min, scr_pos+3, scr_min );
115 drawOneLine( scr_pos, scr_max, scr_pos+3, scr_max );
116 drawOneLine( scr_pos, mid_scr, scr_pos-6, mid_scr );
119 factor = (scr_max-scr_min)/total_amount;
121 for( i=vmin; i<=vmax; i+=1 )
123 if( sub_type == LIMIT )
124 condition = i>= min_value;
125 else if( sub_type == NOLIMIT )
130 marker_y = scr_min+(i-vmin)*factor;
132 if( orientation == LEFT )
134 drawOneLine( marker_x+3, marker_y, marker_x+6, marker_y );
136 else if( orientation == RIGHT )
138 drawOneLine( marker_x, marker_y, marker_x+3, marker_y );
142 drawOneLine( marker_x, marker_y, marker_x+6, marker_y );
143 sprintf( TextScale, "%d", i );
144 if( orientation == LEFT )
146 textString( marker_x-8*strlen(TextScale)-2, marker_y-4, TextScale, GLUT_BITMAP_8_BY_13 );
148 else if( orientation == RIGHT )
150 textString( marker_x+10, marker_y-4, TextScale, GLUT_BITMAP_8_BY_13 );
156 if( type == HORIZONTAL ) // Horizontal scale
158 if( orientation == TOP )
160 else if( orientation == BOTTOM )
161 marker_y = scr_pos-6;
162 drawOneLine( scr_min, scr_pos, scr_max, scr_pos );
163 if( orientation == TOP )
165 drawOneLine( scr_min, scr_pos, scr_min, scr_pos-3 );
166 drawOneLine( scr_max, scr_pos, scr_max, scr_pos-3 );
167 drawOneLine( mid_scr, scr_pos, mid_scr, scr_pos-6 );
168 } else if( orientation == BOTTOM )
170 drawOneLine( scr_min, scr_pos, scr_min, scr_pos+3 );
171 drawOneLine( scr_max, scr_pos, scr_max, scr_pos+3 );
172 drawOneLine( mid_scr, scr_pos, mid_scr, scr_pos+6 );
175 factor = (scr_max-scr_min)/total_amount;
177 for( i=vmin; i<=vmax; i+=1 )
179 if( sub_type == LIMIT )
180 condition = i>= min_value;
181 else if( sub_type == NOLIMIT )
186 marker_x = scr_min+(i-vmin)*factor;
188 if( orientation == TOP )
190 drawOneLine( marker_x, marker_y, marker_x, marker_y+3 );
192 else if( orientation == BOTTOM )
194 drawOneLine( marker_x, marker_y+3, marker_x, marker_y+6 );
198 sprintf( TextScale, "%d", i );
199 if( orientation == TOP )
201 drawOneLine( marker_x, marker_y, marker_x, marker_y+6 );
202 textString( marker_x-4*strlen(TextScale), marker_y+14, TextScale, GLUT_BITMAP_8_BY_13 );
204 else if( orientation == BOTTOM )
206 drawOneLine( marker_x, marker_y, marker_x, marker_y+6 );
207 textString( marker_x+10, marker_y-4, TextScale, GLUT_BITMAP_8_BY_13 );
218 Draws a climb ladder in the center of the HUD
221 Needs: HUD_ladder struct
224 static void drawladder( struct HUD_ladder ladder )
227 double roll_value, pitch_value;
228 /* double cos_roll, sin_roll; */
229 int marker_x, marker_y;
231 int scr_min, scr_max;
234 int new_x_ini, new_x_end;
235 int new_y_ini, new_y_end;
241 roll_value = (*ladder.load_roll)();
242 pitch_value = (*ladder.load_pitch)()*RAD_TO_DEG;
244 vmin = pitch_value-ladder.width_units/2;
245 vmax = pitch_value+ladder.width_units/2;
247 scr_min = ladder.y_pos-(ladder.scr_height/2);
248 scr_max = scr_min+ladder.scr_height;
250 mid_scr = scr_min+(scr_max-scr_min)/2;
252 marker_x = ladder.x_pos-ladder.scr_width/2;
254 factor = (scr_max-scr_min)/ladder.width_units;
256 for( i=vmin; i<=vmax; i+=1 )
261 marker_y = scr_min+(i-vmin)*factor;
262 if( i%ladder.div_units==0 )
264 sprintf( TextLadder, "%d", i );
265 if( ladder.scr_hole == 0 )
268 x_ini = ladder.x_pos-ladder.scr_width/2;
270 x_ini = ladder.x_pos-ladder.scr_width/2-10;
272 x_end = ladder.x_pos+ladder.scr_width/2;
274 new_x_ini = ladder.x_pos+(x_ini-ladder.x_pos)*cos(roll_value)-\
275 (y_ini-ladder.y_pos)*sin(roll_value);
276 new_y_ini = ladder.y_pos+(x_ini-ladder.x_pos)*sin(roll_value)+\
277 (y_ini-ladder.y_pos)*cos(roll_value);
278 new_x_end = ladder.x_pos+(x_end-ladder.x_pos)*cos(roll_value)-\
279 (y_end-ladder.y_pos)*sin(roll_value);
280 new_y_end = ladder.y_pos+(x_end-ladder.x_pos)*sin(roll_value)+\
281 (y_end-ladder.y_pos)*cos(roll_value);
285 drawOneLine( new_x_ini, new_y_ini, new_x_end, new_y_end );
289 glEnable(GL_LINE_STIPPLE);
290 glLineStipple( 1, 0x00FF );
291 drawOneLine( new_x_ini, new_y_ini, new_x_end, new_y_end );
292 glDisable(GL_LINE_STIPPLE);
294 textString( new_x_ini-8*strlen(TextLadder)-8, new_y_ini-4, TextLadder, GLUT_BITMAP_8_BY_13 );
295 textString( new_x_end+10, new_y_end-4, TextLadder, GLUT_BITMAP_8_BY_13 );
300 x_ini = ladder.x_pos-ladder.scr_width/2;
302 x_ini = ladder.x_pos-ladder.scr_width/2-10;
304 x_end = ladder.x_pos-ladder.scr_width/2+ladder.scr_hole/2;
306 new_x_ini = ladder.x_pos+(x_ini-ladder.x_pos)*cos(roll_value)-\
307 (y_ini-ladder.y_pos)*sin(roll_value);
308 new_y_ini = ladder.y_pos+(x_ini-ladder.x_pos)*sin(roll_value)+\
309 (y_ini-ladder.y_pos)*cos(roll_value);
310 new_x_end = ladder.x_pos+(x_end-ladder.x_pos)*cos(roll_value)-\
311 (y_end-ladder.y_pos)*sin(roll_value);
312 new_y_end = ladder.y_pos+(x_end-ladder.x_pos)*sin(roll_value)+\
313 (y_end-ladder.y_pos)*cos(roll_value);
317 drawOneLine( new_x_ini, new_y_ini, new_x_end, new_y_end );
321 glEnable(GL_LINE_STIPPLE);
322 glLineStipple( 1, 0x00FF );
323 drawOneLine( new_x_ini, new_y_ini, new_x_end, new_y_end );
324 glDisable(GL_LINE_STIPPLE);
326 textString( new_x_ini-8*strlen(TextLadder)-8, new_y_ini-4, TextLadder, GLUT_BITMAP_8_BY_13 );
328 x_ini = ladder.x_pos+ladder.scr_width/2-ladder.scr_hole/2;
331 x_end = ladder.x_pos+ladder.scr_width/2;
333 x_end = ladder.x_pos+ladder.scr_width/2+10;
335 new_x_ini = ladder.x_pos+(x_ini-ladder.x_pos)*cos(roll_value)-\
336 (y_ini-ladder.y_pos)*sin(roll_value);
337 new_y_ini = ladder.y_pos+(x_ini-ladder.x_pos)*sin(roll_value)+\
338 (y_ini-ladder.y_pos)*cos(roll_value);
339 new_x_end = ladder.x_pos+(x_end-ladder.x_pos)*cos(roll_value)-\
340 (y_end-ladder.y_pos)*sin(roll_value);
341 new_y_end = ladder.y_pos+(x_end-ladder.x_pos)*sin(roll_value)+\
342 (y_end-ladder.y_pos)*cos(roll_value);
346 drawOneLine( new_x_ini, new_y_ini, new_x_end, new_y_end );
350 glEnable(GL_LINE_STIPPLE);
351 glLineStipple( 1, 0x00FF );
352 drawOneLine( new_x_ini, new_y_ini, new_x_end, new_y_end );
353 glDisable(GL_LINE_STIPPLE);
355 textString( new_x_end+10, new_y_end-4, TextLadder, GLUT_BITMAP_8_BY_13 );
358 /* if( i%max_div==0 )
360 drawOneLine( marker_x, marker_y, marker_x+6, marker_y );
361 sprintf( TextScale, "%d", i );
362 if( orientation == LEFT )
364 textString( marker_x-8*strlen(TextScale)-2, marker_y-4, TextScale, GLUT_BITMAP_8_BY_13 );
366 else if( orientation == RIGHT )
368 textString( marker_x+10, marker_y-4, TextScale, GLUT_BITMAP_8_BY_13 );
378 Draws an artificial horizon line in the center of the HUD
379 (with or without a center hole)
381 Needs: x_center, y_center, length, hole
384 static void drawhorizon( struct HUD_horizon horizon )
388 /* struct fgFLIGHT *f; */
389 double sin_bank, cos_bank;
392 /* f = ¤t_aircraft.flight; */
394 bank_angle = (*horizon.load_value)();
396 // sin_bank = sin( FG_2PI-FG_Phi );
397 // cos_bank = cos( FG_2PI-FG_Phi );
398 sin_bank = sin(FG_2PI-bank_angle);
399 cos_bank = cos(FG_2PI-bank_angle);
400 x_inc1 = (int)(horizon.scr_width*cos_bank);
401 y_inc1 = (int)(horizon.scr_width*sin_bank);
402 x_inc2 = (int)(horizon.scr_hole*cos_bank);
403 y_inc2 = (int)(horizon.scr_hole*sin_bank);
405 if( horizon.scr_hole == 0 )
407 drawOneLine( horizon.x_pos-x_inc1, horizon.y_pos-y_inc1, \
408 horizon.x_pos+x_inc1, horizon.y_pos+y_inc1 );
412 drawOneLine( horizon.x_pos-x_inc1, horizon.y_pos-y_inc1, \
413 horizon.x_pos-x_inc2, horizon.y_pos-y_inc2 );
414 drawOneLine( horizon.x_pos+x_inc2, horizon.y_pos+y_inc2, \
415 horizon.x_pos+x_inc1, horizon.y_pos+y_inc1 );
421 Draws a label anywhere in the HUD
423 Needs: HUD_label struct
426 static void drawlabel( struct HUD_label label )
433 if( label.pre_str != NULL && label.post_str != NULL )
434 sprintf( buffer, "%s%s%s", label.pre_str, label.format, label.post_str );
435 else if( label.pre_str == NULL && label.post_str != NULL )
436 sprintf( buffer, "%s%s", label.format, label.post_str );
437 else if( label.pre_str != NULL && label.post_str == NULL )
438 sprintf( buffer, "%s%s", label.pre_str, label.format );
440 sprintf( string, buffer, (*label.load_value)() );
443 fgPrintf( FG_COCKPIT, FG_DEBUG, buffer );
444 fgPrintf( FG_COCKPIT, FG_DEBUG, "\n" );
445 fgPrintf( FG_COCKPIT, FG_DEBUG, string );
446 fgPrintf( FG_COCKPIT, FG_DEBUG, "\n" );
449 lenstr = strlen( string );
450 if( label.justify == LEFT_JUST )
452 else if( label.justify == CENTER_JUST )
454 else if( label.justify == RIGHT_JUST )
457 if( label.size == SMALL )
458 textString( label.x_pos+posincr, label.y_pos, string, GLUT_BITMAP_8_BY_13);
459 else if( label.size == LARGE )
460 textString( label.x_pos+posincr, label.y_pos, string, GLUT_BITMAP_9_BY_15);
464 double get_speed( void )
468 f = ¤t_aircraft.flight;
469 return( FG_V_equiv_kts );
472 double get_aoa( void )
476 f = ¤t_aircraft.flight;
477 return( FG_Gamma_vert_rad*RAD_TO_DEG );
480 double get_roll( void )
484 f = ¤t_aircraft.flight;
488 double get_pitch( void )
492 f = ¤t_aircraft.flight;
496 double get_heading( void )
500 f = ¤t_aircraft.flight;
501 return( FG_Psi*RAD_TO_DEG );
504 double get_altitude( void )
507 /* double rough_elev; */
509 f = ¤t_aircraft.flight;
510 /* rough_elev = mesh_altitude(FG_Longitude * RAD_TO_ARCSEC,
511 FG_Latitude * RAD_TO_ARCSEC); */
513 return( FG_Altitude * FEET_TO_METER /* - rough_elev */ );
516 void add_instrument( Hptr hud, HIptr instrument )
520 instruments = hud->instruments;
521 // while( ++instruments
524 Hptr fgHUDInit( struct fgAIRCRAFT current_aircraft, int color )
528 hud = (Hptr)calloc(sizeof(struct HUD),1);
535 // For now lets just hardcode a hud here .
536 // In the future, hud information has to come from the same place
537 // aircraft information came
539 fgHUDAddHorizon( hud, 590, 50, 40, 20, get_roll );
540 fgHUDAddScale( hud, VERTICAL, 220, 100, 280, 5, 10, LEFT, LEFT, 0, 100, get_speed );
541 fgHUDAddScale( hud, VERTICAL, 440, 100, 280, 1, 5, RIGHT, RIGHT, -400, 25, get_aoa );
542 fgHUDAddScale( hud, HORIZONTAL, 280, 220, 440, 5, 10, TOP, TOP, 0, 50, get_heading );
543 fgHUDAddLabel( hud, 180, 85, SMALL, NOBLINK, RIGHT_JUST, NULL, " Kts", "%5.0f", get_speed );
544 fgHUDAddLabel( hud, 180, 73, SMALL, NOBLINK, RIGHT_JUST, NULL, " m", "%5.0f", get_altitude );
545 fgHUDAddLadder( hud, 330, 190, 90, 180, 70, 10, NONE, 45, get_roll, get_pitch );
550 Hptr fgHUDAddHorizon( Hptr hud, int x_pos, int y_pos, int length, \
551 int hole_len, double (*load_value)() )
553 struct HUD_horizon *horizon;
554 struct HUD_instr *instrument;
555 HIptr tmp_first, tmp_next;
557 tmp_first = hud->instruments;
558 if( tmp_first != NULL )
559 tmp_next = tmp_first->next;
563 instrument = (HIptr)calloc(sizeof(struct HUD_instr),1);
564 if( instrument == NULL )
567 horizon = (struct HUD_horizon *)calloc(sizeof(struct HUD_horizon),1);
568 if( horizon == NULL )
571 instrument->type = ARTIFICIAL_HORIZON;
572 instrument->instr.horizon = *horizon;
573 instrument->instr.horizon.x_pos = x_pos;
574 instrument->instr.horizon.y_pos = y_pos;
575 instrument->instr.horizon.scr_width = length;
576 instrument->instr.horizon.scr_hole = hole_len;
577 instrument->instr.horizon.load_value = load_value;
578 instrument->next = tmp_first;
580 hud->instruments = instrument;
585 Hptr fgHUDAddScale( Hptr hud, int type, int scr_pos, int scr_min, int scr_max, int div_min, int div_max, \
586 int orientation, int with_min, int min_value, int width_units, double (*load_value)() )
588 struct HUD_scale *scale;
589 struct HUD_instr *instrument;
590 HIptr tmp_first, tmp_next;
592 tmp_first = hud->instruments;
593 if( tmp_first != NULL )
594 tmp_next = tmp_first->next;
598 instrument = (HIptr)calloc(sizeof(struct HUD_instr),1);
599 if( instrument == NULL )
602 scale = (struct HUD_scale *)calloc(sizeof(struct HUD_scale),1);
606 instrument->type = SCALE;
607 instrument->instr.scale = *scale;
608 instrument->instr.scale.type = type;
609 instrument->instr.scale.scr_pos = scr_pos;
610 instrument->instr.scale.scr_min = scr_min;
611 instrument->instr.scale.scr_max = scr_max;
612 instrument->instr.scale.div_min = div_min;
613 instrument->instr.scale.div_max = div_max;
614 instrument->instr.scale.orientation = orientation;
615 instrument->instr.scale.with_minimum = with_min;
616 instrument->instr.scale.minimum_value = min_value;
617 instrument->instr.scale.width_units = width_units;
618 instrument->instr.scale.load_value = load_value;
619 instrument->next = tmp_first;
621 hud->instruments = instrument;
626 Hptr fgHUDAddLabel( Hptr hud, int x_pos, int y_pos, int size, int blink, int justify, \
627 char *pre_str, char *post_str, char *format, double (*load_value)() )
629 struct HUD_label *label;
630 struct HUD_instr *instrument;
631 HIptr tmp_first, tmp_next;
633 tmp_first = hud->instruments;
634 if( tmp_first != NULL )
635 tmp_next = tmp_first->next;
639 instrument = (HIptr)calloc(sizeof(struct HUD_instr),1);
640 if( instrument == NULL )
643 label = (struct HUD_label *)calloc(sizeof(struct HUD_label),1);
647 instrument->type = LABEL;
648 instrument->instr.label = *label;
649 instrument->instr.label.x_pos = x_pos;
650 instrument->instr.label.y_pos = y_pos;
651 instrument->instr.label.size = size;
652 instrument->instr.label.blink = blink;
653 instrument->instr.label.justify = justify;
654 instrument->instr.label.pre_str = pre_str;
655 instrument->instr.label.post_str = post_str;
656 instrument->instr.label.format = format;
657 instrument->instr.label.load_value = load_value;
658 instrument->next = tmp_first;
660 hud->instruments = instrument;
665 Hptr fgHUDAddLadder( Hptr hud, int x_pos, int y_pos, int scr_width, int scr_height, \
666 int hole_len, int div_units, int label_pos, int width_units, \
667 double (*load_roll)(), double (*load_pitch)() )
669 struct HUD_ladder *ladder;
670 struct HUD_instr *instrument;
671 HIptr tmp_first, tmp_next;
673 tmp_first = hud->instruments;
674 if( tmp_first != NULL )
675 tmp_next = tmp_first->next;
679 instrument = (HIptr)calloc(sizeof(struct HUD_instr),1);
680 if( instrument == NULL )
683 ladder = (struct HUD_ladder *)calloc(sizeof(struct HUD_ladder),1);
687 instrument->type = LADDER;
688 instrument->instr.ladder = *ladder;
689 instrument->instr.ladder.type = 0; // Not used.
690 instrument->instr.ladder.x_pos = x_pos;
691 instrument->instr.ladder.y_pos = y_pos;
692 instrument->instr.ladder.scr_width = scr_width;
693 instrument->instr.ladder.scr_height = scr_height;
694 instrument->instr.ladder.scr_hole = hole_len;
695 instrument->instr.ladder.div_units = div_units;
696 instrument->instr.ladder.label_position = label_pos;
697 instrument->instr.ladder.width_units = width_units;
698 instrument->instr.ladder.load_roll = load_roll;
699 instrument->instr.ladder.load_pitch = load_pitch;
700 instrument->next = tmp_first;
702 hud->instruments = instrument;
708 Hptr fgHUDAddMovingHorizon( Hptr hud, int x_pos, int y_pos, int length, int hole_len, \
714 Hptr fgHUDAddCircularLadder( Hptr hud, int scr_min, int scr_max, int div_min, int div_max, \
720 Hptr fgHUDAddNumDisp( Hptr hud, int x_pos, int y_pos, int size, int color, int blink, \
721 char *pre_str, char *post_str )
727 void fgUpdateHUD( Hptr hud )
730 union HUD_instr_data instr_data;
732 glMatrixMode(GL_PROJECTION);
736 gluOrtho2D(0, 640, 0, 480);
737 glMatrixMode(GL_MODELVIEW);
741 glColor3f(1.0, 1.0, 1.0);
744 glDisable(GL_DEPTH_TEST);
745 glDisable(GL_LIGHTING);
748 glColor3f (0.1, 0.9, 0.1);
751 fgPrintf( FG_COCKPIT, FG_DEBUG, "HUD Code %d Status %d\n",
752 hud->code, hud->status );
754 hud_instr = hud->instruments;
755 while( hud_instr != NULL )
757 instr_data = hud_instr->instr;
759 fgPrintf( FG_COCKPIT, FG_DEBUG,
760 "Instr Type %d SubType %d Orient %d\n",
761 hud_instr->type, hud_instr->sub_type, hud_instr->orientation );
763 if( hud_instr->type == ARTIFICIAL_HORIZON )
765 drawhorizon( instr_data.horizon );
766 /* drawhorizon( instr_data.horizon.x_pos, instr_data.horizon.y_pos, \
767 instr_data.horizon.scr_width, instr_data.horizon.scr_hole ); */
769 else if( hud_instr->type == SCALE )
771 drawscale( instr_data.scale.type, instr_data.scale.with_minimum, \
772 instr_data.scale.minimum_value, instr_data.scale.orientation, \
773 instr_data.scale.scr_pos, instr_data.scale.scr_min, \
774 instr_data.scale.scr_max, instr_data.scale.width_units, \
775 instr_data.scale.div_min, instr_data.scale.div_max, \
776 (*instr_data.scale.load_value)() );
778 else if( hud_instr->type == LABEL )
780 drawlabel( instr_data.label );
781 /* drawlabel( instr_data.label.x_pos, instr_data.label.y_pos, instr_data.label.size, \
782 instr_data.label.blink, instr_data.label.pre_str, instr_data.label.post_str, \
783 instr_data.label.format, (*instr_data.label.load_value)() ); */
785 else if( hud_instr->type == LADDER )
787 drawladder( instr_data.ladder );
789 hud_instr = hud_instr->next;
793 glEnable(GL_DEPTH_TEST);
794 glEnable(GL_LIGHTING);
795 glMatrixMode(GL_PROJECTION);
797 glMatrixMode(GL_MODELVIEW);
804 /* Revision 1.9 1998/01/31 00:43:04 curt
805 /* Added MetroWorks patches from Carmen Volpe.
807 * Revision 1.8 1998/01/27 00:47:51 curt
808 * Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
809 * system and commandline/config file processing code.
811 * Revision 1.7 1998/01/19 18:40:20 curt
812 * Tons of little changes to clean up the code and to remove fatal errors
813 * when building with the c++ compiler.
815 * Revision 1.6 1997/12/15 23:54:34 curt
816 * Add xgl wrappers for debugging.
817 * Generate terrain normals on the fly.
819 * Revision 1.5 1997/12/10 22:37:39 curt
820 * Prepended "fg" on the name of all global structures that didn't have it yet.
821 * i.e. "struct WEATHER {}" became "struct fgWEATHER {}"
823 * Revision 1.4 1997/09/23 00:29:32 curt
824 * Tweaks to get things to compile with gcc-win32.
826 * Revision 1.3 1997/09/05 14:17:26 curt
827 * More tweaking with stars.
829 * Revision 1.2 1997/09/04 02:17:30 curt
832 * Revision 1.1 1997/08/29 18:03:22 curt