-
Notifications
You must be signed in to change notification settings - Fork 1
/
glut_viewer.h
55 lines (42 loc) · 1.13 KB
/
glut_viewer.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
#ifndef _GLUT_VIEWER_H_
#define _GLUT_VIEWER_H_
#include "viewer.h"
namespace Renzoku {
class GlutViewer : public Viewer {
public:
GlutViewer(int height, int width);
~GlutViewer();
public:
void run();
void redisplay();
/**
* GLUT callback functions
*/
void init(int argc, char **argv);
void reshape(int width, int height);
void timer(int val);
void display();
void mouse(int button, int state, int x, int y);
void motion(int x, int y);
void keyboard(unsigned char key, int x, int y);
};
class GlutWrapper {
public:
GlutWrapper();
~GlutWrapper();
public:
void set_viewer(GlutViewer *viewer);
public:
static void reshape(int width, int height);
static void timer(int val);
static void display();
static void mouse(int button, int state, int x, int y);
static void motion(int x, int y);
static void keyboard(unsigned char key, int x, int y);
static MouseButton glut_to_mouse_button(int button);
static MouseState glut_to_mouse_state(int state);
private:
static GlutViewer *viewer;
};
} // end namespace
#endif