Make functions const ref
parent
606e554f6c
commit
93d27519ca
|
@ -57,11 +57,11 @@ class window {
|
||||||
virtual inline bool isKeyDown(int key) const { return keysDown.at(key); }
|
virtual inline bool isKeyDown(int key) const { return keysDown.at(key); }
|
||||||
virtual inline bool isMouseDown(int button) const {return mouseDown.at(button);};
|
virtual inline bool isMouseDown(int button) const {return mouseDown.at(button);};
|
||||||
// Function signature is window pointer to this, key press, pressed/released (true/false)
|
// Function signature is window pointer to this, key press, pressed/released (true/false)
|
||||||
virtual inline void registerKeyListener(std::function<void(window*, int, bool)> listener) {
|
virtual inline void registerKeyListener(const std::function<void(window*, int, bool)>& listener) {
|
||||||
keyListeners.push_back(listener);
|
keyListeners.push_back(listener);
|
||||||
}
|
}
|
||||||
// Function signature is window pointer to this, mouse button press, pressed/released (true/false)
|
// Function signature is window pointer to this, mouse button press, pressed/released (true/false)
|
||||||
virtual inline void registerMouseListener(std::function<void(window*, int, bool)> listener) {
|
virtual inline void registerMouseListener(const std::function<void(window*, int, bool)>& listener) {
|
||||||
mouseListeners.push_back(listener);
|
mouseListeners.push_back(listener);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue