00001
00009 #ifndef _MAIN_H
00010 #define _MAIN_H
00011
00012 #include "psi3d/macros.h"
00013 #include "userkeys.h"
00014
00015 #include "cPad.h"
00016 #include "cController.h"
00017 #include "cBackground.h"
00018 #include "cMission.h"
00019 #include "cWorld.h"
00020 #include "cObject.h"
00021 #include "cWeapon.h"
00022 #include "cMech.h"
00023 #include "cBuilding.h"
00024 #include "cTree.h"
00025
00026 #define DEFAULT_FULLSCREEN true
00027 #define DEFAULT_FPS 29
00028 #define DEFAULT_XRES 800
00029 #define DEFAULT_YRES 600
00030 #define DEFAULT_BPP 16
00031 #define DEFAULT_FOV 60
00032
00038 struct cGame {
00040 cPad* pad1;
00041
00043 int* map1;
00044
00046 cObject* camera;
00047
00049 cWorld *world;
00050
00052 int mission;
00053
00055 string bgm;
00056
00058 bool paused;
00059
00061 bool fullscreen;
00062
00064 bool wireframe;
00065
00067 bool nightvision;
00068
00070 bool printpad;
00071
00073 float fps;
00074
00076 int width;
00077
00079 int height;
00080
00082 int depth;
00083
00085 int multisamples;
00086
00088 int fov;
00089
00093 cGame();
00094
00098 void printHelp();
00099
00105 int parseArgs(int argc, char** args);
00106
00110 void initMission();
00111
00112 };
00113
00114
00115
00116 #include <SDL/SDL.h>
00117 #include <SDL/SDL_timer.h>
00118 #include <GL/gl.h>
00119 #include <GL/glu.h>
00120 #include <AL/al.h>
00121 #include <AL/alc.h>
00122 #ifndef __WIN32
00123 #include <AL/alext.h>
00124 #else
00125 PFNGLTEXIMAGE3DPROC glTexImage3D;
00126 #endif
00127 #include <AL/alut.h>
00128 #include <iostream>
00129
00130
00135 struct cMain {
00136 static cGame game;
00137
00139 static void initGL(int width, int height);
00140
00142 static void drawFrame(int elapsed_msec);
00143
00145 static void updateKey(Uint8 keysym);
00146
00148 static void updatePad(cPad* pad, SDL_Joystick* joy, int* mapping);
00149
00151 static int sdlmain(int argc, char** args);
00152 };
00153
00154
00155 #endif