Event Receiver, need basic concepts

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
AnX
Posts: 7
Joined: Mon Jan 12, 2004 8:25 pm
Location: Brazil

Event Receiver, need basic concepts

Post by AnX »

I'm having a lot of trouble to understand the Tutorial 4. Movement, that describes the use of Event Receiver.
Can any help me with one single concept on HOW-IT-WORKS ?
I need to create a class to handle all events and "register" it on createDevice...ok, but it don't work for me.
Any type of explaination will be very helpful...
Thankz.
"We are all lost, like tears in the rain and the water from above kills the eternal flame"
Guest

Post by Guest »

Hi AnX

the event receiver works by means of callback. But, I think that's not what You were looking for. :wink:
Could you post a link to Your code? It's very difficult to just guess what's going wrong :?

Moni
keless
Posts: 805
Joined: Mon Dec 15, 2003 10:37 pm
Location: Los Angeles, California, USA

Post by keless »

when you create a class that inherits from IEventReceiver, it will have an OnEvent function.

you then register this class with the device (either in CreateDevice() or using device->setEventReceiver() )

when an event is generated in IrrLicht an SEvent object is created and filled in with the information specific to that event. It is then passed to the current Event Reciever's OnEvent function.

if you have multiple classes which need to recieve events, you should have one eventReciever which will get the SEvent and pass it to these other classes.

for my spin on how to do this, please view the ICE source code:
http://www.skyesurfer.net/keless/IrrLicht/ICE/
a screen cap is worth 0x100000 DWORDS
Post Reply