-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathui.h
More file actions
56 lines (51 loc) · 969 Bytes
/
ui.h
File metadata and controls
56 lines (51 loc) · 969 Bytes
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
#ifndef UI_H
#define UI_H
#include "renderer.h"
#include "simulator.h"
#include "pbody.h"
#include "helper.h"
#include "vec2d.h"
#define RMBB 0
#define CREATE 1
#define RMBNB 2
#define SELECT 3
#define MOVE 4
#define STATIC 5
static char statelist[10][255] = {"RMBB\0","CREATE\0", "RMBNB\0", "SELECT\0", "MOVE\0", "STATIC\0"};
class ui
{
friend class pbody;
friend class simulator;
friend class renderer;
private:
void onLMBD();
void onLMBU();
void onRMBD();
void onRMBU();
void onMM();
void onKeyDown(int key);
void onKeyUp(int key);
public:
void init(simulator * s, renderer * r);
simulator * sim;
renderer * rend;
ui();
pbody* body_at_click;
pbody* body_at_cursor;
pbody* newbody;
vec2 pol_to_create[3];
vec2 click_pos;
vec2 mouse_pos;
vec2 impulse_apply_vector;
vec2 impulse_line_begin;
int click_count;
int _X, _Y;
void update();
int state;
char debugstr[255];
int oldstate;
int dx, dy;
float fps;
float fpstmp;
};
#endif //UI_H