input problem
Posted: Fri Dec 21, 2007 5:21 pm
Weird, I've rechecked my code it's almost the same with tut 4. I've no idea why this thing comes out.
Thanks.
I'm using Irrlicht 1.4 (not svn) and using Visual C++ 2005 express.------ Build started: Project: ComingBackHome, Configuration: Debug Win32 ------
Compiling...
main.cpp
c:\comingbackhome\main.h(58) : error C2259: 'MyEventReceiver' : cannot instantiate abstract class
due to following members:
'bool irr::IEventReceiver::OnEvent(const irr::SEvent &)' : is abstract
c:\irrlicht-1.4\include\ieventreceiver.h(256) : see declaration of 'irr::IEventReceiver::OnEvent'
Build log was saved at "file://c:\ComingBackHome\Debug\BuildLog.htm"
GoingHome - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Code: Select all
class MyEventReceiver : public IEventReceiver
{
public:
virtual bool OnEvent(SEvent event)
{
if (event.EventType == irr::EET_KEY_INPUT_EVENT && event.KeyInput.PressedDown)
{
switch(event.KeyInput.Key)
{
case KEY_KEY_W:
{
break;
}
case KEY_KEY_S:
{
break;
}
default:
return true;
}
}
return false;
}
};