Event Processing With External Window ID
Posted: Wed Apr 01, 2015 3:45 am
Hi there, I am creating my Irrlicht context with custom creation parameters as here:
All of my window events are handled manually and process things such as window events, keyboard handling and so forth.
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)
It appears that system messages and events are still being processed by Irrlicht, despite the fact that I have specified it not to do so.
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)
I am not sure if this is going to cause unforeseen problems in the future, but for the moment it seems to be working for me with no side effects.
Thank you for your review and consideration.
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.