-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathcontroller.h
More file actions
60 lines (46 loc) · 1.26 KB
/
Copy pathcontroller.h
File metadata and controls
60 lines (46 loc) · 1.26 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
#ifndef _CONTROLLER_H
#define _CONTROLLER_H
#include "core.h"
#include "object.h"
#include "arcball.h"
#include "camera.h"
#include "timer.h"
class Controller {
public:
Controller(int argc,char **argv, const char *windowName);
~Controller();
void BeginLoop();
void RegisterObject(Object* object);
void Reset();
void Render();
void InitCamera();
int GetActiveObject(int mx, int my);
void Quit();
// Event handlers
void Resize(GLFWwindow *window, int x, int y);
void Keyboard(GLFWwindow * window, int key, int scancode,int action, int mods);
void MouseButton(GLFWwindow *window, int btn, int action, int mods);
void MouseMotion(GLFWwindow *window, double x, double y);
void MouseScroll(GLFWwindow *window, double x, double y);
private:
// Window management
std::string _windowName;
std::stringstream _titleInfo;
GLFWwindow *_windowHandle;
int _winX, _winY;
// Input
bool _isLeftKeyPressed, _isCtrlPressed, _isRightKeyPressed, _isMiddleKeyPressed;
bool _isLightOn;
double _prevCursorX, _prevCursorY;
Object** _objects;
int _objectNo;
int _maxObjectNo;
int _activeObj;
Camera* _camera;
void _ComputeFPS();
Timer _timer;
double _elapsedTime;
int _numOfFrame;
double _fps;
};
#endif