/* * GRacer * * Copyright (C) 1999 Takashi Matsuda * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA */ #ifndef __GRACER_GLUT_GAME_H__ #define __GRACER_GLUT_GAME_H__ #include "tcldefs.h" #include "gluttclwidgets.h" #include #include #include "vehicle.h" #include "gr_world.h" #include "sound.h" #ifdef __cplusplus extern "C" { #endif #if 0 } #endif typedef struct GrViewer GrViewer; typedef struct GrViewerEntryInfo GrViewerEntryInfo; typedef struct GrViewerOverheadInfo GrViewerOverheadInfo; typedef struct GrTclTrigger GrTclTrigger; typedef enum { GR_VIEWER_USE_TEXTURE = 1 << 0, GR_VIEWER_USE_MIPMAP = 1 << 1, GR_VIEWER_USE_LINEAR = 1 << 2, GR_VIEWER_USE_SHADING = 1 << 3, GR_VIEWER_SHOW_SKY = 1 << 4, GR_VIEWER_SHOW_DECR = 1 << 5, GR_VIEWER_USE_AUDIO = 1 << 6, } GrViewerOption; struct GrTclTrigger { GrTrigger core; int key; Tcl_Interp *interp; Tcl_Obj *script; }; struct GrViewerOverheadInfo { float xmax, zmax; float xpan, zpan; float left, right, top, bottom; float near, far; float xangle; float yangle; float zangle; }; typedef void (*GrViewerProjectionFunc) (GlutObject); struct GrViewer { GlutRoot core; GrWorld *world; GrViewerOption options; Tcl_Interp *interp; Tcl_Command token; Tcl_HashTable entry_hash; Tcl_HashTable trigger_hash; int trigger_key; GLfloat zpan; GLfloat xangle, yangle, zangle; int use_texture; int use_mipmap; int use_linear; int use_shading; int show_sky; int show_decr; int use_audio; GrObjectDrawOption draw_option; GrScene *course; GLuint dl; GrScene *sky; GLuint sky_dl; GrScene *rpm; GLuint rpm_measure_dl, rpm_arrow_dl; double rpm_angle; GrScene *font; GLuint lfont_dl; GLuint sfont_dl; GLuint laps_dl; int lap_changed; int max_lap; double current_time; double start_time; GrViewerEntryInfo *trace; GrViewerProjectionFunc projection_func; struct { GrViewerOverheadInfo overhead; } projection_info; GrSample *exhaust; GrEnvelope *exhaust_freq; GrSample *slip; int slip_playing; }; struct GrViewerEntryInfo { int no; GLfloat xangle, yangle, zangle; GLfloat pos[3]; double speed; /* [km/h] */ GrVehicle *vehicle; }; int GrViewer_Init (Tcl_Interp *interp); GrViewerOption gr_viewer_get_options (GrViewer *viewer); void gr_viewer_set_options (GrViewer *viewer, GrViewerOption opt); #ifdef __cplusplus } #endif #endif /* __GRACER_GLUT_GAME_H__ */