Game Development Community

Newbie question - XNA and Torque X

by Jeffrey Smith · in Torque X 2D · 07/09/2007 (12:09 pm) · 3 replies

I just started with the 2 published Torque X tutorials. It works very well. I have a newbie question.

Is it possible to use Torque X (inherit from TorqueGame class) and XNA Framework (inherit from Microsoft.Xna.Framework.Game and using the XNA "loop"). I know C# doesn't import multiple inheritance but wondered if there was another way around this. If so, is there a good example of this that exists, no matter how simple?

#1
07/09/2007 (3:03 pm)
Before I attempt to answer your question and potentially give you bad advice that might be misleading, can you explain what you're trying to achieve by getting to the XNA "loop"? Usually with Torque X it's better to try to solve problems in a distributed way rather than trying to find a procedural "game loop".
#2
07/09/2007 (5:23 pm)
Sure. I'm trying to prepare for a game programming course. The students are well schooled in XNA and there is a lot of documentation on XNA programming. This school was leaning towards XNA exclusively, but Torque X (I argue) should turn this situation around. Though it may be better to solve problems completely within Torque X, Torque X is a good tranisiton (until 3d support is ready and there are books on the subject) from XNA. The Torque benes are clear. In the mean time, it would be nice to be able to have the flexibility of programming with the best of both worlds. Windows controls, forms, XNA framework capability and 3d support, using legacy XNA code when needed, but expoiting Torque X for effects, animation, XML data/control separation, etc. As Torque X is better understood, one can phase out the unnecessary other parts. Lastly, I just wanted to know, to know. I'm not fixated on the game loop of XNA but would like to salvage what is known. Particularly when the GUI for Torque X is supposed to be C#. Ignoring XNA, it would be nice to see examples of say windows/C#/.Net controls used in a Torque X example. I hope this helps.
#3
07/10/2007 (9:52 am)
I'm not sure what you mean by "the GUI for Torque X is supposed to be C#". There is a GUI system in Torque X, although it's kind of clunky to use (no editor) and is poorly documented right now.

As for using "regular XNA" on top of Torque X, you're straying pretty far from my areas of expertise or experience. Obviously we're more focused on trying to make Torque X a complete solution rather than trying to create hybrid systems, so you may be headed into uncharted waters, at least from my perspective. With the caveat that I may not know what I'm talking about, you may be able to do what you want by creating objects that inherit from GuiControl and define their own render method.

The TorqueGame class inherits from Microsoft.Xna.Framework.Game so you may be able to take advantage of that in some way.