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.
Event Receiver, need basic concepts
Event Receiver, need basic concepts
"We are all lost, like tears in the rain and the water from above kills the eternal flame"
-
Guest
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/
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