Ogre interfering with filewatcher

Problems building or running the engine, queries about how to use features etc.
Post Reply
Kim2
Greenskin
Posts: 117
Joined: Mon Jun 16, 2008 12:29 pm

Ogre interfering with filewatcher

Post by Kim2 »

In my program I am using this: http://www.ogre3d.org/forums/viewtopic.php?f=5&t=47925 filewatcher code which constantly polls for changes to a directory. For some reason when I call createRenderWindow after loading a render plugin the filewatcher stops working (as in, it no longer detects changes to any of the watched directories). This happens in ogre 1_10 and 2_10 (1_9 untested) with both the opengl and direct3d11 plugins. My code isn't doing anything unusual, just loading the plugin and creating the window.

The filewatcher uses ReadDirectoryChangesW with a callback to receive notifications of changes in a watched directory.

I was wondering if anyone might have any idea why this is happening?

Edit:

It looks like the call to MsgWaitForMultipleObjectsEx made during the filewatcher update is receiving event messages from the window and this is blocking ReadDirectoryChangesW somehow. I'm not sure why this would be stopping the file events or how to get around it in a multi-threaded environment where ogre and the filewatcher are in their own threads.

void FileWatcherWin32::update()
{
MsgWaitForMultipleObjectsEx(0, NULL, 0, QS_ALLINPUT, MWMO_ALERTABLE);
}
Post Reply