Compiling Tge/tgb As Dll
by Funky Diver · in Torque Game Engine · 09/14/2006 (2:45 am) · 1 replies
Greetings!
What are the major steps to compile TGE/TGB as a DLL in VS2005/2003?
Should I just change the output binary type? Do I need to twick the code somehow?
Using TGE as a DLL, can I attach it to a window handle (windows/mac)?
Any links to TDN/forum post will be appreciated as I couldn't find the example...
I know that Neil Marshall did something similar, so it would be nice if Nail answer my post ;)
I also tried to find the pyTSE module, but cannot (I have TSE license as well)...
Thank you!
What are the major steps to compile TGE/TGB as a DLL in VS2005/2003?
Should I just change the output binary type? Do I need to twick the code somehow?
Using TGE as a DLL, can I attach it to a window handle (windows/mac)?
Any links to TDN/forum post will be appreciated as I couldn't find the example...
I know that Neil Marshall did something similar, so it would be nice if Nail answer my post ;)
I also tried to find the pyTSE module, but cannot (I have TSE license as well)...
Thank you!
Torque Owner Aaron Wieland
My changes included the following:
(1) I added a file that exported DLL functions -- to start/stop the engine, to execute an iteration of the game loop, and to expose the scripting interface.
(2) I added helper functions to main.cc to support (1). Sadly, this required copying and pasting code from DemoGame::main(), because the code for initialization/shutdown and running the game loop isn't well-factored.
(3) In winWindow.cc, I commented out the code in Platform::process() for processing the windows message queue, because the DLL is run within the client's process, and I wanted the client to have sole responsibility for processing windows messages. I also added some helper functions akin to those in (2) (more copying and pasting -- grrr...). The helper function for initializing the engine returns the HWND; TGB retains responsibility for creating the window, but the client (Dolphin Smalltalk, in my case) subclasses the window and substitutes its own window proc for handling messages.
Obviously, I'm glossing over the details. Also, I've changed only the Windows code, though I doubt that the equivalent Mac changes would be difficult. I'd like to compare notes with Josh Ritter and find out how he implemented PyTSE (I don't own TSE).
(P.S.: I recently won a TGE license. Otherwise, I wouldn't have been able to respond to this post.)