Torque in Microsoft .NET
by Randall Miller · in Technical Issues · 11/18/2002 (6:21 pm) · 10 replies
I'm hoping someone out there more clever than myself is doing some Torque development using .NET and can give me some advice. Basically, what I've attempted to do is:
1. Build the Torque engine as a .lib
2. Wrap this lib in a Managed C++ class library (.dll)
3. Create a C# windows application to do business.
My hope was to be able to expose Torque functionality to my C# application via Managed C++ interfaces. The problem I face is that most of the Torque from engine.lib is not included in the dll i create since the linker strips out unused methods. I don't want to compile Torque into IL, nor do i want to wrap each source module in unmanaged pragmas. I'm thinking i need to "kick" my class library to access the darker regions of Torque before they will be included in the dll. Any advice or suggestions towards a more elegant solution would be appreciated!
1. Build the Torque engine as a .lib
2. Wrap this lib in a Managed C++ class library (.dll)
3. Create a C# windows application to do business.
My hope was to be able to expose Torque functionality to my C# application via Managed C++ interfaces. The problem I face is that most of the Torque from engine.lib is not included in the dll i create since the linker strips out unused methods. I don't want to compile Torque into IL, nor do i want to wrap each source module in unmanaged pragmas. I'm thinking i need to "kick" my class library to access the darker regions of Torque before they will be included in the dll. Any advice or suggestions towards a more elegant solution would be appreciated!
#2
11/18/2002 (8:00 pm)
I wish there was a "real" reason I'm trying to use Torque and C#, but I'm learning .NET for work and it seems like a good challenge. I'm really only expecting to write the AI/GameLogic and database layer in C#, so hopefully the garbage collector will have minimal impact on the overall performance of the game. Regardless, I probably need to get more familiar with Torque before I continue the perverse act of making it work with .NET
#4
I doubt c# is much slower than Torque Script is, i'm not sure that a lot of the .net stuff is fast enough for any kind of realtime use, but it would make a solid back end.
I haven't done this, but it's definatly on my "Things to do" list. I'll try put some more feedback here when i've had a play.
The main trouble with this approach is that you lose Torques cross platform ability :(
11/19/2002 (7:35 am)
It's no worse than C++, Torque Script, OS.I doubt c# is much slower than Torque Script is, i'm not sure that a lot of the .net stuff is fast enough for any kind of realtime use, but it would make a solid back end.
I haven't done this, but it's definatly on my "Things to do" list. I'll try put some more feedback here when i've had a play.
The main trouble with this approach is that you lose Torques cross platform ability :(
#5
Is there a different reason?
04/21/2003 (3:34 pm)
Just a quick reply, that's quite an interesting theory that you "lose" crossplatform ability. How do you figure that? I know it can not be due to .NET, since .NET is runable from over 4 different OSes. WinOS, BSD, Linux, MAC OSX.Is there a different reason?
#6
The c# on other platforms is pretty good, just not the .net bits.
I long hope for the day when this isn't the case though, if there was a .net Linux platform as good as the M$ one i'd never touch windows again.
04/21/2003 (3:43 pm)
Last time I looked all (couple of months back) the non-M$ platforms have large chunks of the .net platform missing. Unless they've come leaps and bounds since then there's not a chance they'd be fully usable in this way.The c# on other platforms is pretty good, just not the .net bits.
I long hope for the day when this isn't the case though, if there was a .net Linux platform as good as the M$ one i'd never touch windows again.
#7
Two reasons: "viewable original source", and speed.
:)
04/21/2003 (4:58 pm)
Keep your eye out on Mono, in May.. I really can't say much more then that right now. Though why would anybody want to use a scripting language for an engine, instead of a programming language is beyond me :)Two reasons: "viewable original source", and speed.
:)
#8
Yes, you can compile a simple C# program and run it. Maybe you can compile and run a not so simple program. But it's still at 0.24, so I don't think it can be used for serious purposes.
Even Java, which is intended to be cross platform and directly supported as such by Sun, has portability problems. Why do you expect this to be better coming from MS, (in)famous for their undocumented functions and their desire (and track record) to bash competition?
05/13/2003 (7:37 am)
Saying that .net is runnable over Mono is highly dependant on your definition of "runnable" :)Yes, you can compile a simple C# program and run it. Maybe you can compile and run a not so simple program. But it's still at 0.24, so I don't think it can be used for serious purposes.
Even Java, which is intended to be cross platform and directly supported as such by Sun, has portability problems. Why do you expect this to be better coming from MS, (in)famous for their undocumented functions and their desire (and track record) to bash competition?
#9
05/13/2003 (8:23 am)
Why does every little question about .NET have to turn into Microsoft bashing?
#10
05/13/2003 (9:46 am)
its not Bashing it is a knee jerk reaction to the propoganda that .Net is "mature", "portable" and "cross platform" when the REALITY is that about as far from the truth as possible. Unless "cross platform" and "portable" means Windows 98, Windows ME, Windows NT, Windows 2000 and Windows XP . . .
Torque Owner Mz
What are you trying to accomplish here?