IEventReceiver problem

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
overburn
Posts: 101
Joined: Sun Nov 04, 2007 8:08 am
Location: Romania, Ploiesti

IEventReceiver problem

Post 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 :)
One Tequila, Two Tequila, Three Tequila, Floor.
_______________________________________
ASUS P5V-VM Ultra
Intel Pentium D930
1x 2GB DDR2 Kingmax 800mhz/533mhz mb
Leadtek PX9600GT W 512MB DDR3
200GB Maxtor HDD
drewbacca
Posts: 38
Joined: Tue Jan 30, 2007 6:49 pm

Post 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?
overburn
Posts: 101
Joined: Sun Nov 04, 2007 8:08 am
Location: Romania, Ploiesti

Post 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 :)
One Tequila, Two Tequila, Three Tequila, Floor.
_______________________________________
ASUS P5V-VM Ultra
Intel Pentium D930
1x 2GB DDR2 Kingmax 800mhz/533mhz mb
Leadtek PX9600GT W 512MB DDR3
200GB Maxtor HDD
Post Reply