1- For the first way, is it possible in my code to pass to the device 2 methods setEventReceiver? Because i need my own external event receiver for the general code, and i need also the event for the camera, so is it possible to have 2 eventReceiver for the device?
2- For the 4th way, if i write this code, would it work?
Code: Select all
/* My own external event receiver class */
class MyEventReceiver : public IEventReceiver
{
public:
MyEventReceiver(bool* keysDown)
{
u32 k = 0;
for (k = 0; k < KEY_KEY_CODES_COUNT; ++k)
{
m_keysDown[k] = keysDown[k];
}
}
bool OnEvent(SEvent event)
{
if(event.EventType == EET_KEY_INPUT_EVENT)
{
m_keysDown[event.KeyInput.Key] = event.KeyInput.PressedDown;
return true;
}
else
{
return false;
}
}
private:
bool m_keysDown[KEY_KEY_CODES_COUNT];
};
/* My main function */
int main()
{
/*....... My code ......*/
MyEventReceiver receiver(Camera.getKeysDown());
device->setEventReceiver(&receiver);
/*........ My code .....*/
}
EDIT The answer for my first question is no, so i foget it.
I've tried the second way but i've an error who says:
"can not declare variable 'camera' to be of type 'RTSCamera'
because the following virtuals functions are abstract:
virtual void irr::scene::ISceneNode::render()
........."
Someone can explain me this error and how to resolve it?[/b]