If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Malgodur
Posts: 195 Joined: Sun Mar 15, 2009 8:22 pm
Post
by Malgodur » Fri Jun 12, 2009 3:05 pm
Crash on device start. Can somebody explain me why? heres code
Code: Select all
class CEventReceiver : public IEventReceiver
{
public:
bool OnEvent(const SEvent& event)
{
if (event.EventType == EET_KEY_INPUT_EVENT)
{
if (event.KeyInput.PressedDown) return false;
if (event.KeyInput.Key == KEY_KEY_C)
{
//smgr->getActiveCamera()->setInputReceiverEnabled(true);
return false;
}
else if (event.KeyInput.Key == KEY_KEY_V)
{
//smgr->getActiveCamera()->setInputReceiverEnabled(false);
return false;
}
}
return true;
}
};
Code: Select all
CEventReceiver rec;
device = createDevice(video::EDT_DIRECT3D9, core::dimension2d<s32>(640, 480), 16, false,false,false,&rec);
When i remove &rec from createDevice everythings ok. Please help.
Acki
Posts: 3496 Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:
Post
by Acki » Fri Jun 12, 2009 3:11 pm
hmm, I can't reproduce it...
your code works for me...
maybe show the whole code...
but one thing: where you return true you should return false and vice versa...
Malgodur
Posts: 195 Joined: Sun Mar 15, 2009 8:22 pm
Post
by Malgodur » Fri Jun 12, 2009 6:47 pm
Well, so it isnt caused by some kind of my noob'by bug:D ? The whole code is a bit big, Im mixing another graphic engine (with its input reciever) with irrlicht, now Im sure that's caused by this.... however thanks for reply.
Edit: Indeed, I got the ride of 3rd stuff and now recevier works how it should!