Game Development Community

Stopping multiple instances

by Neil Marshall · in Torque Game Engine · 05/16/2006 (7:03 am) · 1 replies

I'm working on the plugin version of TGE and it works a little differently from the standalone. When you close a browser window with TGE in it, it doesn't shut down fully. It runs through the shutdown process and then starts the initalization agian when you go back to the page. It never truely exits until you close your browser entirly.

When you open a second browser window it runs through the initalization process again and this is where my problem is. Because the engine is already initalized the frameAllocator freaks out. I need to stop it from being able to initalize if it is already running and possibly paint a useful error in the second browser window.

How would I go about doing this? I'm assuming I need to create a mutex lock or something but I don't know the specifics of how to do it. Can anyone help?

I started off creating a boolean value but quickly realized that it wouldn't work because keyboard events and stuff wouldn't know if they were in the original plugin or the secondary one.