-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCGLUTApplication.h
More file actions
96 lines (80 loc) · 2.01 KB
/
CGLUTApplication.h
File metadata and controls
96 lines (80 loc) · 2.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#ifndef CGLUT_APPLICATION_H_INCL
#define CGLUT_APPLICATION_H_INCL
#include "opengl.h"
#include "physics.h"
#include "glsl.h"
#include "CEventReceiver.h"
#include "CScene.h"
#include "CCameraFPS.h"
#include "CCameraFollower.h"
#include "CCar.h"
#include "CObjectCheckpointController.h"
#include "COverlayText.h"
#include "CTimer.h"
struct SGLUTParameters
{
SGLUTParameters() : WindowX(0), WindowY(0), WindowW(640), WindowH(480),
WindowTitle(0), DoubleBuffering(true), FSAA(false), Car(0), SkyDome(0)
{
}
int WindowX;
int WindowY;
int WindowW;
int WindowH;
const char* WindowTitle;
bool DoubleBuffering;
bool FSAA;
char* Car;
char* SkyDome;
};
class CGLUTApplication : public CEventReceiver
{
public:
CGLUTApplication(const SGLUTParameters& param);
~CGLUTApplication();
void init();
void step();
float getTimeStep();
void render();
void mouseMove(int x, int y);
void generateCity();
CCar* addCar(const char* propFile);
void resetCar(CCar* car);
bool keyDown(char key);
bool keyUp(char key);
bool keyPressed(char key);
bool keyReleased(char key);
virtual void displayFunc();
virtual void idleFunc();
virtual void mouseFunc(int button, int state, int x, int y);
virtual void reshapeFunc(int w, int h);
virtual void keyboardFunc(unsigned char c, int x, int y);
virtual void keyboardUpFunc(unsigned char c, int x, int y);
virtual void specialFunc(int c, int x, int y);
virtual void motionFunc(int x, int y);
virtual void passiveMotionFunc(int x, int y);
private:
void updateKeyStrokes();
bool DoubleBuffering;
CScene* Scene;
CPhysicsWorld* Physics;
cwc::glShaderManager* ShaderManager;
btClock Clock;
CTimer Timer;
CObjectCheckpointController* CPController;
CCameraFPS* CameraFPS;
CCameraFollower* Camera;
CCameraFollower* CameraBumper;
CCar* Vehicle;
std::vector<CCar*> Vehicles;
//std::vector<CObject*> VehiclesClosest;
std::vector<COverlayText*> Overlays;
COverlayText* Overlay;
CSpline* Spline;
char* car;
char* skyDome;
bool KeyDown[256];
bool KeyDownPrev[256];
bool isPlaying;
};
#endif