Now the only thing missing is the drawing loop using IrrlichtDevice::run(). We do this as usual. But instead of this, there is another possibility: You can also simply use your own message loop using GetMessage, DispatchMessage and whatever. Calling Device->run() will cause Irrlicht to dispatch messages internally too. You need not call Device->run() if you want to do your own message dispatching loop, but Irrlicht will not be able to fetch user input then and you have to do it on your own using the window messages, DirectInput, or whatever.
An event receiver object should work properly, right? But it isn't, I'm unable to detect mouse input, already debugged it and OnEvent function isn't being called.
is there any way to make it work or I'll need to write my own event receiver with the Windows API? Is it possible to make the Irrlicht event receiver work like that? Is it possible to detect when the Irrlicht render area of the window is being focused?
What are you trying? When you don't call run() the eventreceiver will not receive any events (as run() does the checking for system events). So if you don't call that but still want Irrlicht do get the event then you have to send them to Irrlicht yourself. I think you can use IrrlichtDevice::postEventFromUser for that. That way you can inform Irrlicht about mouse-events etc.
Hm, maybe you additionally catch the events in the messageloop in another places? run() basically read the messageloop and takes all events it find there. If you have another part of your application doing that as well you'll run into problems (as then 2 different parts of your application will clean up the Windows messages at different times more or less randomly - each stealing events from the other).
So only use run() if you want Irrlicht to handle the events. If you have another framework handling events you have to pass them on manually to Irrlicht like I described in the last post.
CuteAlien wrote:Hm, maybe you additionally catch the events in the messageloop in another places? run() basically read the messageloop and takes all events it find there. If you have another part of your application doing that as well you'll run into problems (as then 2 different parts of your application will clean up the Windows messages at different times more or less randomly - each stealing events from the other).
So only use run() if you want Irrlicht to handle the events. If you have another framework handling events you have to pass them on manually to Irrlicht like I described in the last post.
It seems that it's exactly what's happening, i have some events of the Windows API running, i removed the cursor of the Windows API and now OnEvent is being properly called, unfortunately removing the cursor made the whole Windows API broken, only remaining the Irrlicht render, so it isn't a solution(stupid idea, i know), but your solution seems fine and relatively easy to implement... Thanks.