DirectX Rendering
by Playware · in Torque Game Builder · 11/22/2007 (6:34 pm) · 6 replies
Hi,
I understand that the T2D engine is an OpenGL Engine. But I wanted to render it using D3D, so I found out that the procedure is through modification of the defaultPrefs.cs as following
--------
$pref::Video::displayDevice = "D3D";
$pref::Video::preferOpenGL = 0;
$pref::Video::allowOpenGL = 0;
$pref::Video::allowD3D = 1;
--------
Is this true D3D? or just a hack?
Well, We are developing a game targeting the XBOX360. We are presently using the TGB 1.5.1 for the prototype. We plan to use it with the XDK from Microsoft.. is this possible? Has somebody attempted this before? if possible, What may be the potential hurdles? Will be able to integrate HLSL with the source??
Thanks in Advance.
Cheers,
Sharath
I understand that the T2D engine is an OpenGL Engine. But I wanted to render it using D3D, so I found out that the procedure is through modification of the defaultPrefs.cs as following
--------
$pref::Video::displayDevice = "D3D";
$pref::Video::preferOpenGL = 0;
$pref::Video::allowOpenGL = 0;
$pref::Video::allowD3D = 1;
--------
Is this true D3D? or just a hack?
Well, We are developing a game targeting the XBOX360. We are presently using the TGB 1.5.1 for the prototype. We plan to use it with the XDK from Microsoft.. is this possible? Has somebody attempted this before? if possible, What may be the potential hurdles? Will be able to integrate HLSL with the source??
Thanks in Advance.
Cheers,
Sharath
About the author
#2
Well, Our bet is mostly with TGB, with modifications and integrations with the XDK.. Can you please help me out how the opengl2D3D wrapper is working?
Thanks,
Sharath
11/22/2007 (10:27 pm)
Thanks Joe, We do have TXB as an option, but still wondering if its worth the change? Also, our intention is to integrate with the XDK from Microsoft and XDK is in C++ and may have some major issues if we do shift to TXB.. Also, I do not have access to the source of TXB with just an Indie developer licence... Well, Our bet is mostly with TGB, with modifications and integrations with the XDK.. Can you please help me out how the opengl2D3D wrapper is working?
Thanks,
Sharath
#3
11/25/2007 (10:49 am)
Sorry, I don't really have experience with TXB or XDK, only TGB on the PC. The wrapper seems to just replace OpenGL functions with similarly named functions written in DirectX calls. So the engine only needs to be written with OpenGL calls, but supports DirectX through the wrapper.
#4
I recently did some work on getting it migrated to Direct3D9:
http://www.garagegames.com/mg/forums/result.thread.php?qt=69442
11/25/2007 (11:12 am)
TGB's D3D7 wrapper actually renders faster here than the unwrapped OpenGL calls.I recently did some work on getting it migrated to Direct3D9:
http://www.garagegames.com/mg/forums/result.thread.php?qt=69442
#5
Update---
After Integration, I was able to build the dll's, but am getting a few linker warnings:
all references to GDI32.dll discarded by /OPT:REF
all references to WINMM.dll discarded by /OPT:REF
all references to d3dx9_35.dll discarded by /OPT:REF
My demo game is working fine with the newly built dlls... I am not sure whether I should panic here?? Can somebody brief me about this?
Thanks
11/25/2007 (6:34 pm)
Thanks Prairie Games and also Nick Basargekar for the code.. I just downloaded the source, looking forward to the integration.. Will post the update soon.. Thanks to you too, Joe.Update---
After Integration, I was able to build the dll's, but am getting a few linker warnings:
all references to GDI32.dll discarded by /OPT:REF
all references to WINMM.dll discarded by /OPT:REF
all references to d3dx9_35.dll discarded by /OPT:REF
My demo game is working fine with the newly built dlls... I am not sure whether I should panic here?? Can somebody brief me about this?
Thanks
#6
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
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
Torque Owner Joe Rossi
Indri Games
If you must develop for XBOX, TXB might be a better option for you. I doubt you can use HLSL.. not without major source changes anyway.