Game Development Community

TGB Direct3D9 Port

by Prairie Games · in Torque Game Builder · 11/20/2007 (6:33 am) · 11 replies

The TGB OpenGL to Direct3D wrapper is really quite good. Kudos to whomever touched it up (PatW?)... the wrapper runs faster on my 6800 than the unwrapped OpenGL calls!

The only problem is that the wrapper is using Direct3D7 interfaces... which means it doesn't play nicely with Direct3D9 (and friends). So, I've started to move the wrapper to Direct3D9. This isn't trivial because so much changed between the two...

I am wondering if anyone else has already done a port, started working on one, or plans to... please contact me if there's the possibility of it saving some pain :)

joshe at prairiegames.com

#1
11/20/2007 (11:33 am)
Alright, its pretty much done... If you have C++ access, you can snag the code in this thread:

http://www.garagegames.com/mg/forums/result.thread.php?qt=69451

Here's a binary (you'll need the VS2005 SP1 redist installed)

*** Sorry, over the years we've lost the file below. Send it to Support@PrairieGames.com if you have a copy, thank you!
TGB_Direct3D9_Binary.zip

If you run into any problems or have fixes, please post them.

-PG
#2
11/20/2007 (11:36 am)
I knew that if I waited until after lunch, you'd come up with something!
#3
11/20/2007 (11:47 am)
Hah, well I had to run home and dig out an ancient code backup from 2003... I'm not sure what version of Torque is was but it mostly patched. The resource patch is pretty unhappy with TGE 1.3 + Lighting Kit which is pretty much the oldest version I can download.

So, merged against ancient code... then merged against TGB 1.5.1 and TGE 1.5.2 changes... and voila :)

The hard work was done by Nick Basargekar who created the original TGE DX9 patch ... thanks Nick!

:)
#4
11/29/2007 (1:55 pm)
Have you looked at the EaseWrapper Library of Ease Production once? EaseWrapper library allows you using DirectX 9.0 and OpenGL in a same way, with a clean and easy-to-use interface.

EaseWrapper library

You can get the EaseWrapper SDK sources under L-GPL licence in the download section !
#5
11/29/2007 (2:09 pm)
@Prairie Games: could you make the sources available in one of the private TGE forums as well? I don't have access to the private TGB forums. Thanks.
#6
11/29/2007 (2:49 pm)
@Derry
Here's the patch for TGE that is in the link Josh provided.
#7
11/29/2007 (7:25 pm)
@David: Thanks, but that's not the same code he is talking about is it? I was thinking he had updated the code for TGE 1.5.2.
#8
11/30/2007 (6:30 am)
He ported it to TGB.
#9
11/30/2007 (6:43 am)
The D3D wrapper works great with TGB. In fact, it renders faster than the unwrapped GL calls on my 6800 under XP!!! I wouldn't recommend using the D3D wrapper with TGE. If you need D3D support, TGEA is probably your best option...
#10
11/30/2007 (8:20 pm)
@David: I guess I misunderstood, I thought the line "So, merged against ancient code... then merged against TGB 1.5.1 and TGE 1.5.2 changes... and voila :)" meant that he had made it work with TGE 1.5.2.

At any rate, using the patched binaries with TGE and starter.fps it still doesn't work correctly for me. Still it would be nice to have the DX9 source to work with fixing bugs going forward with TGE. Even if GG isn't going to fix this, at least this gives us something to work with.
#11
12/10/2007 (6:54 pm)
Noticed a problem with this mod recently. Not sure if anyone else share the same bug?

Details of the bug: D3D Fullscreen rendering causes a crash. This does'nt happen while toggling from windowed mode to fullscreen mode, only when starting the game in fullscreen directly.

Not sure what the problem is?

Thanks

PS: I have modified the common/gamescripts/canvas.cs to use the $pref::Video::fullscreen variable