Page 1 of 1

IEventReceiver problem

Posted: Thu Apr 09, 2009 6:13 pm
by overburn
ok.. i have a class derived from irr::IEventReceiver
when i declare it in another class, i get that it doesn't exist when i try to compile.
i thought maybe it should be a pointer, but then i have no idea how to initialize it ... any ideas?
thx :)

Posted: Thu Apr 09, 2009 7:37 pm
by drewbacca
The examples show how to derive from irr::IEventReceiver

http://irrlicht.sourceforge.net/docu/example005.html
http://irrlicht.sourceforge.net/docu/example009.html

There really isn't a whole lot to it. just create an instance of your class, and pass a pointer to that instance when calling device->setEventReceiver()

What is your exact compiler error?

Posted: Fri Apr 10, 2009 4:57 am
by overburn
I wasn't passing it by pointer , and i got that the class i deriverd from IEventReceiver was undefined(this is the error)..
when i was passing it by pointer, the program would crash at runtime, because my class wasn't getting initialized i presume
But i solved it - i moved the whole body of the class into the file wihich also has the root class , and it worked passing it directly :)