44 lines
949 B
C++
44 lines
949 B
C++
#ifndef _INPUT_H_
|
|
#define _INPUT_H_
|
|
|
|
#include <stdlib.h>
|
|
#include <GL/glut.h>
|
|
|
|
#include "structs.h"
|
|
|
|
class Input {
|
|
public:
|
|
|
|
static inline Input* getInstance() {
|
|
return & m_instance;
|
|
}
|
|
|
|
GLvoid keyboard_event(GLubyte key, GLint x, GLint y);
|
|
GLvoid menu( int value );
|
|
GLvoid passive_motion(GLint mx, GLint my);
|
|
GLvoid button_motion(GLint mx, GLint my);
|
|
GLvoid mouse_button(GLint btn, GLint state, GLint mx, GLint my);
|
|
|
|
enum {
|
|
ZOOM_IN_EVENT,
|
|
ZOOM_OUT_EVENT,
|
|
ANIMATE_EVENT,
|
|
LINES_EVENT,
|
|
FULL_EVENT
|
|
};
|
|
|
|
private:
|
|
|
|
inline Input() {;}
|
|
|
|
static Input m_instance;
|
|
|
|
Point oldPoint;
|
|
|
|
void calcAngle(GLfloat *newMatrix, GLfloat angle, Point& a);
|
|
void scalePoint(Point& p, GLint mx, GLint my);
|
|
|
|
};
|
|
|
|
#endif
|