-
Notifications
You must be signed in to change notification settings - Fork 0
/
GraphicsTemplate.cpp
66 lines (45 loc) · 1.72 KB
/
GraphicsTemplate.cpp
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
// GraphicsTemplate.cpp
//
//////////////////////////////////////////////////////////////////////////////////////////
// includes
//////////////////////////////////////////////////////////////////////////////////////////
#include "stdafx.h"
//////////////////////////////////////////////////////////////////////////////////////////
// externals
//////////////////////////////////////////////////////////////////////////////////////////
extern cRenderClass graphics;
//////////////////////////////////////////////////////////////////////////////////////////
// renderScene() - render the scene
//////////////////////////////////////////////////////////////////////////////////////////
void renderScene()
{
graphics.render();
}
//////////////////////////////////////////////////////////////////////////////////////////
// update() - update function
//////////////////////////////////////////////////////////////////////////////////////////
NA_HeatLamp heatLamp;
void update()
{
// add any update code here...
// heatlamp should be attached to the mouse cursor
heatLamp.pos.x = graphics.mousePos.x;
heatLamp.pos.y = graphics.mousePos.y;
heatLamp.pos.z = 0;
// always re-render the scene..
renderScene();
}
//////////////////////////////////////////////////////////////////////////////////////////
// _tmain() - program entry point
//////////////////////////////////////////////////////////////////////////////////////////
int _tmain(int argc, _TCHAR* argv[])
{
// init glut stuff..
graphics.create(argc, argv);
// good place for one-off initialisations and objects creation..
extern NA_Pig pig;
pig.init();
// enter game loop..
graphics.loop();
return 0;
}