Problems with EventReceiver

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.
Post Reply
DChrisO
Posts: 3
Joined: Wed Mar 24, 2004 3:50 pm

Problems with EventReceiver

Post by DChrisO »

Hi!

I created the device object in a class called Application but when I try to set the event receiver the programm crashes. I made the device object public and tried to set the event receiver from outside and it worked... Is there anything I have to do if I use the device object in a class?

Thanks for your help
Chris
Tyn
Posts: 932
Joined: Thu Nov 20, 2003 7:53 pm
Location: England
Contact:

Post by Tyn »

If it is in the same class, then use "this" instead of "&event"
DChrisO
Posts: 3
Joined: Wed Mar 24, 2004 3:50 pm

Post by DChrisO »

nope the event class is called MyEventReceiver...
elhim
Posts: 16
Joined: Sat Mar 13, 2004 12:37 am
Location: LI, NY

Post by elhim »

Well most probably the program segfaults. It's hard to tell without the code, but one thing i know is that you have to instantiate the receiver before you pass it to the device constructor. That is if you have it on the heap, which you probably do, and if you don't the problem might be that the object goes out of scope. Seeing your code could help, because there're so many things that could go wrong.
DChrisO
Posts: 3
Joined: Wed Mar 24, 2004 3:50 pm

Post by DChrisO »

Oh thanks a lot! It wasn't on the heap :)[/code]
Post Reply