-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgraphics.h
81 lines (61 loc) · 1.96 KB
/
graphics.h
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
#ifndef graphics_h
#define graphics_h
#include <cstdlib>
#include <winuser.h>
#include "winuser.h"
#ifdef _WIN32
#include <windows.h>
#else
#include <sys/time.h>
#endif
#ifdef __APPLE__
#include <GLUT/glut.h>
#else
#include <GL/glut.h>
#endif
/** Const Variables */
const int DEFAULT_WINDOW_WIDTH = 1400;
const int DEFAULT_WINDOW_HEIGHT = 700;
const double DEFAULT_LINE_COLOR_RGB[3] = {0.0, 0.0, 0.0};
const double DEFAULT_BACKGROUND_COLOR_RGBA[4] = {0.9, 0.9, 0.86, 1.0};
const double ORTHO_ZOOM = 700;
/// Keybinds
/* Movement */
const char UP_KEY = VK_SPACE; // Space
const char DOWN_KEY = VK_SHIFT; // Shift
const char RIGHT_KEY = 0x44; // D
const char LEFT_KEY = 0x41; // A
const char FORWARD_KEY = 0x57; // W
const char BACK_KEY = 0x53; // S
const char OUT_KEY = 0x51; // Q
const char IN_KEY = 0x45; // E
/* Rotation */
const char ROT_RIGHT_KEY = 0x4C; // L
const char ROT_LEFT_KEY = 0x4A; // J
const char ROT_UP_KEY = 0x49; // I
const char ROT_DOWN_KEY = 0x4B; // K
const char ROT_OUT_KEY = 0x4F; // O
const char ROT_IN_KEY = 0x55; // U
/* Other */
//const char TOGGLE_ACTIVE_CAMERA_KEY = 0x54; // T
const char TOGGLE_ACTIVE_CAMERA_KEY = 't';
const char TOGGLE_MOVEMENT_MODE = VK_CONTROL; // Control
// Program initialization NOT OpenGL/GLUT dependent,
// as we haven't created a GLUT window yet
void initScene();
// Initialize OpenGL Graphics
void initGL();
// Callback functions for GLUT
// Draw the window - this is where all the GL actions are
void display();
// Trap and process alphanumeric keyboard events
void kbd(unsigned char key, int x, int y);
// Trap and process special keyboard events
void kbdS(int key, int x, int y);
// Handle "mouse cursor moved" events
void cursor(int x, int y);
// Calls itself after a specified time
void timer(int dummy);
// Handle mouse button pressed and released events
void mouse(int button, int state, int x, int y);
#endif /* graphics_h */