Code: Select all
irr::SIrrlichtCreationParameters irr_params;
irr_params.EventReceiver = NULL;
irr_params.WindowId = reinterpret_cast<void*>( window_handle );
I found that (specifically on the win32 build, but perhaps also in other operating systems) the device run() command is still processing window events as here:
(CIrrDeviceWin32.cpp)
Code: Select all
bool CIrrDeviceWin32::run()
{
os::Timer::tick();
static_cast<CCursorControl*>(CursorControl)->update();
handleSystemMessages();
if (!Close)
resizeIfNecessary();
if(!Close && JoyControl)
JoyControl->pollJoysticks();
_IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
return !Close;
}
I discovered this problem when keyboard events were being misinterpreted or lost in some circumstances. If I do not execute the device's run() function every frame in my game/engine, there are no problems.
Basically, Irrlicht's window message and event handling functionality is currently flawed and needs to be fixed.
I have temporarily fixed my problem by commenting over the conflicting functions in the run() function as so:
(CIrrDeviceWin32.cpp)
Code: Select all
bool CIrrDeviceWin32::run()
bool CIrrDeviceWin32::run()
{
os::Timer::tick();
//static_cast<CCursorControl*>(CursorControl)->update();
//handleSystemMessages();
//if (!Close)
// resizeIfNecessary();
//if(!Close && JoyControl)
// JoyControl->pollJoysticks();
_IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
return !Close;
}
Thank you for your review and consideration.