35 #ifndef _InputDevice_H__ 36 #define _InputDevice_H__ 120 template <
class Traits>
127 static const OIS::Type OISDeviceValue = Traits::OISDeviceValue;
133 , oisInputManager_(oisInputManager)
135 oisDevice_ =
static_cast<OISDeviceClass*
>(oisInputManager_->createInputObject(OISDeviceValue,
true));
138 oisDevice_->setEventCallback(static_cast<DeviceClass*>(
this));
147 oisInputManager_->destroyInputObject(oisDevice_);
152 <<
"Potential resource leak!" << endl;
159 oisDevice_->capture();
162 for (ButtonType& button : pressedButtons_)
164 state->template buttonEvent<ButtonEvent::THold, typename Traits::ButtonTypeParam>(
165 this->
getDeviceID(),
static_cast<DeviceClass*
>(
this)->getButtonEventArg(button));
171 static_cast<DeviceClass*
>(
this)->updateImpl(time);
177 pressedButtons_.clear();
178 static_cast<DeviceClass*
>(
this)->clearBuffersImpl();
191 unsigned int iButton = 0;
192 while (iButton < pressedButtons_.size() && pressedButtons_[iButton] != button)
194 if (iButton == pressedButtons_.size())
195 pressedButtons_.push_back(button);
201 state->template buttonEvent<ButtonEvent::TPress, typename Traits::ButtonTypeParam>(this->
getDeviceID(),
static_cast<DeviceClass*
>(
this)->getButtonEventArg(button));
209 for (
unsigned int iButton = 0; iButton < pressedButtons_.size(); iButton++)
211 if (pressedButtons_[iButton] == button)
213 pressedButtons_.erase(pressedButtons_.begin() + iButton);
223 state->template buttonEvent<ButtonEvent::TRelease, typename Traits::ButtonTypeParam>(this->
getDeviceID(),
static_cast<DeviceClass*
>(
this)->getButtonEventArg(button));
::std::string string
Definition: gtest-port.h:756
Output level, usually not visible, used for unimportant debug information.
Definition: OutputDefinitions.h:99
Output level, used for error messages which are important for developers.
Definition: OutputDefinitions.h:95
Definition: OISException.h:51
Declaration of facilities to handle exceptions.
OutputStream & orxout(OutputLevel level=level::debug_output, const OutputContextContainer &context=context::undefined())
This helper function returns a reference to a commonly used instance of OutputStream.
Definition: Output.h:81
Die Wagnis Klasse hat die folgenden Aufgaben:
Definition: ApplicationPaths.cc:66
Defines the helper function orxout() and includes all necessary headers to use the output system...
Type
Each Input class has a General Type variable, a form of RTTI.
Definition: OISPrereqs.h:138
Simple real time clock based on Ogre::Timer.
Definition: Clock.h:57
#define ORX_FORCEINLINE
Definition: OrxonoxConfig.h:95
float getDeltaTime() const
Returns the timespan in seconds between the last two calls to capture()
Definition: Clock.h:89
const char * eText
A message passed along when the exception was raised.
Definition: OISException.h:71