framework2
123 строки · 3.3 Кб
1#include "ofBaseApp.h"
2#include "ofEvents.h"
3
4ofBaseApp::ofBaseApp() {
5mouseX = mouseY = 0;
6}
7
8ofBaseApp::~ofBaseApp(){
9}
10
11void ofBaseApp::setup(){}
12void ofBaseApp::update(){}
13void ofBaseApp::draw(){}
14void ofBaseApp::exit(){}
15
16void ofBaseApp::windowResized(int w, int h){}
17
18void ofBaseApp::keyPressed( int key ){}
19void ofBaseApp::keyReleased( int key ){}
20
21/// \brief Called on the active window when the mouse is moved
22void 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
26void ofBaseApp::mouseDragged( int x, int y, int button ){}
27
28/// \brief Called on the active window when a mouse button is pressed
29void ofBaseApp::mousePressed( int x, int y, int button ){}
30
31/// \brief Called on the active window when a mouse button is released
32void ofBaseApp::mouseReleased(int x, int y, int button ){}
33
34void ofBaseApp::mouseScrolled(int x, int y, float scrollX, float scrollY ){}
35
36void ofBaseApp::mouseEntered( int x, int y ){}
37
38void ofBaseApp::mouseExited( int x, int y){}
39
40void ofBaseApp::dragEvent(ofDragInfo dragInfo) { }
41void ofBaseApp::gotMessage(ofMessage msg){ }
42
43void ofBaseApp::setup(ofEventArgs & args){
44setup();
45}
46void ofBaseApp::update(ofEventArgs & args){
47update();
48}
49void ofBaseApp::draw(ofEventArgs & args){
50draw();
51}
52void ofBaseApp::exit(ofEventArgs & args){
53exit();
54}
55
56void ofBaseApp::windowResized(ofResizeEventArgs & resize){
57windowResized(resize.width,resize.height);
58}
59
60void ofBaseApp::keyPressed( ofKeyEventArgs & key ){
61keyPressed(key.key);
62}
63void ofBaseApp::keyReleased( ofKeyEventArgs & key ){
64keyReleased(key.key);
65}
66
67void ofBaseApp::mouseMoved( ofMouseEventArgs & mouse ){
68mouseX=mouse.x;
69mouseY=mouse.y;
70mouseMoved(mouse.x,mouse.y);
71}
72void ofBaseApp::mouseDragged( ofMouseEventArgs & mouse ){
73mouseX=mouse.x;
74mouseY=mouse.y;
75mouseDragged(mouse.x,mouse.y,mouse.button);
76}
77void ofBaseApp::mousePressed( ofMouseEventArgs & mouse ){
78mouseX=mouse.x;
79mouseY=mouse.y;
80mousePressed(mouse.x,mouse.y,mouse.button);
81}
82void ofBaseApp::mouseReleased(ofMouseEventArgs & mouse){
83mouseX=mouse.x;
84mouseY=mouse.y;
85mouseReleased(mouse.x,mouse.y,mouse.button);
86}
87void ofBaseApp::mouseScrolled( ofMouseEventArgs & mouse ){
88mouseScrolled(mouse.x, mouse.y, mouse.scrollX, mouse.scrollY);
89}
90void ofBaseApp::mouseEntered( ofMouseEventArgs & mouse ){
91mouseEntered(mouse.x,mouse.y);
92}
93void ofBaseApp::mouseExited( ofMouseEventArgs & mouse ){
94mouseExited(mouse.x,mouse.y);
95}
96void ofBaseApp::dragged(ofDragInfo & drag){
97dragEvent(drag);
98}
99void ofBaseApp::messageReceived(ofMessage & message){
100gotMessage(message);
101}
102
103void ofBaseApp::touchDown(int x, int y, int id) {};
104void ofBaseApp::touchMoved(int x, int y, int id) {};
105void ofBaseApp::touchUp(int x, int y, int id) {};
106void ofBaseApp::touchDoubleTap(int x, int y, int id) {};
107void ofBaseApp::touchCancelled(int x, int y, int id) {};
108
109void ofBaseApp::touchDown(ofTouchEventArgs & touch) {
110touchDown(touch.x, touch.y, touch.id);
111};
112void ofBaseApp::touchMoved(ofTouchEventArgs & touch) {
113touchMoved(touch.x, touch.y, touch.id);
114};
115void ofBaseApp::touchUp(ofTouchEventArgs & touch) {
116touchUp(touch.x, touch.y, touch.id);
117};
118void ofBaseApp::touchDoubleTap(ofTouchEventArgs & touch) {
119touchDoubleTap(touch.x, touch.y, touch.id);
120};
121void ofBaseApp::touchCancelled(ofTouchEventArgs & touch){
122touchCancelled(touch.x, touch.y, touch.id);
123}
124