framework2

Форк
0
123 строки · 3.3 Кб
1
#include "ofBaseApp.h"
2
#include "ofEvents.h"
3

4
ofBaseApp::ofBaseApp() {
5
	mouseX = mouseY = 0;
6
}
7

8
ofBaseApp::~ofBaseApp(){
9
}
10

11
void ofBaseApp::setup(){}
12
void ofBaseApp::update(){}
13
void ofBaseApp::draw(){}
14
void ofBaseApp::exit(){}
15

16
void ofBaseApp::windowResized(int w, int h){}
17

18
void ofBaseApp::keyPressed( int key ){}
19
void ofBaseApp::keyReleased( int key ){}
20

21
/// \brief Called on the active window when the mouse is moved
22
void ofBaseApp::mouseMoved( int x, int y ){}
23

24
/// \brief Called on the active window when the mouse is dragged, i.e.
25
/// moved with a button pressed
26
void ofBaseApp::mouseDragged( int x, int y, int button ){}
27

28
/// \brief Called on the active window when a mouse button is pressed
29
void ofBaseApp::mousePressed( int x, int y, int button ){}
30

31
/// \brief Called on the active window when a mouse button is released
32
void ofBaseApp::mouseReleased(int x, int y, int button ){}
33

34
void ofBaseApp::mouseScrolled(int x, int y, float scrollX, float scrollY ){}
35

36
void ofBaseApp::mouseEntered( int x, int y ){}
37

38
void ofBaseApp::mouseExited( int x, int y){}
39

40
void ofBaseApp::dragEvent(ofDragInfo dragInfo) { }
41
void ofBaseApp::gotMessage(ofMessage msg){ }
42

43
void ofBaseApp::setup(ofEventArgs & args){
44
	setup();
45
}
46
void ofBaseApp::update(ofEventArgs & args){
47
	update();
48
}
49
void ofBaseApp::draw(ofEventArgs & args){
50
	draw();
51
}
52
void ofBaseApp::exit(ofEventArgs & args){
53
	exit();
54
}
55

56
void ofBaseApp::windowResized(ofResizeEventArgs & resize){
57
	windowResized(resize.width,resize.height);
58
}
59

60
void ofBaseApp::keyPressed( ofKeyEventArgs & key ){
61
	keyPressed(key.key);
62
}
63
void ofBaseApp::keyReleased( ofKeyEventArgs & key ){
64
	keyReleased(key.key);
65
}
66

67
void ofBaseApp::mouseMoved( ofMouseEventArgs & mouse ){
68
	mouseX=mouse.x;
69
	mouseY=mouse.y;
70
	mouseMoved(mouse.x,mouse.y);
71
}
72
void ofBaseApp::mouseDragged( ofMouseEventArgs & mouse ){
73
	mouseX=mouse.x;
74
	mouseY=mouse.y;
75
	mouseDragged(mouse.x,mouse.y,mouse.button);
76
}
77
void ofBaseApp::mousePressed( ofMouseEventArgs & mouse ){
78
	mouseX=mouse.x;
79
	mouseY=mouse.y;
80
	mousePressed(mouse.x,mouse.y,mouse.button);
81
}
82
void ofBaseApp::mouseReleased(ofMouseEventArgs & mouse){
83
	mouseX=mouse.x;
84
	mouseY=mouse.y;
85
	mouseReleased(mouse.x,mouse.y,mouse.button);
86
}
87
void ofBaseApp::mouseScrolled( ofMouseEventArgs & mouse ){
88
	mouseScrolled(mouse.x, mouse.y, mouse.scrollX, mouse.scrollY);
89
}
90
void ofBaseApp::mouseEntered( ofMouseEventArgs & mouse ){
91
	mouseEntered(mouse.x,mouse.y);
92
}
93
void ofBaseApp::mouseExited( ofMouseEventArgs & mouse ){
94
	mouseExited(mouse.x,mouse.y);
95
}
96
void ofBaseApp::dragged(ofDragInfo & drag){
97
	dragEvent(drag);
98
}
99
void ofBaseApp::messageReceived(ofMessage & message){
100
	gotMessage(message);
101
}
102

103
void ofBaseApp::touchDown(int x, int y, int id) {};
104
void ofBaseApp::touchMoved(int x, int y, int id) {};
105
void ofBaseApp::touchUp(int x, int y, int id) {};
106
void ofBaseApp::touchDoubleTap(int x, int y, int id) {};
107
void ofBaseApp::touchCancelled(int x, int y, int id) {};
108

109
void ofBaseApp::touchDown(ofTouchEventArgs & touch) {
110
	touchDown(touch.x, touch.y, touch.id);
111
};
112
void ofBaseApp::touchMoved(ofTouchEventArgs & touch) {
113
	touchMoved(touch.x, touch.y, touch.id);
114
};
115
void ofBaseApp::touchUp(ofTouchEventArgs & touch) {
116
	touchUp(touch.x, touch.y, touch.id);
117
};
118
void ofBaseApp::touchDoubleTap(ofTouchEventArgs & touch) {
119
	touchDoubleTap(touch.x, touch.y, touch.id);
120
};
121
void ofBaseApp::touchCancelled(ofTouchEventArgs & touch){
122
	touchCancelled(touch.x, touch.y, touch.id);
123
}
124

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.