Author Topic: Using XNA  (Read 4628 times)

leopark

  • Visitor
  • *
  • Posts: 2
    • View Profile
    • Email
Using XNA
« on: 2008-01-01, 11:16:07 PM »
Its possible use XNA in SGDK2?

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: Using XNA
« Reply #1 on: 2008-01-02, 06:41:24 AM »
That's a very good question.  XNA and SGDK2 both use .NET (though SGDK 2.0.0 is using .NET 1.1 and XNA uses .NET 2.0) and XNA is even based on Visual Studio (though I'm not sure how similar the XNA version of Visual Studio is to the versions that I'm familiar with).  What I can tell you is this: when SGDK2 compiles a project, it generates all the source code into a Visual Studio project that can be Loaded into Visual Studio 2003 or imported into Visual C# Express and manually edited or compiled.  It would be very interesting to know if XNA can load/import, compile, debug and work with this project, or integrate with SGDK2 in other ways.  Would you be willing to experiment with this for us and let us know what you find?  It's very possible that SGDK2 could be used to enhance XNA in various ways.  It may also be possible to somehow integrate code and resources created with XNA into an SGDK2 project (in the project's Source Code folder).

leopark

  • Visitor
  • *
  • Posts: 2
    • View Profile
    • Email
Re: Using XNA
« Reply #2 on: 2008-01-02, 04:03:54 PM »
Ok. I will try here the XNA with SGDK2. I know a little schedule with XNA, why did the question.

Richard Kain

  • Regular
  • **
  • Posts: 23
    • View Profile
Re: Using XNA
« Reply #3 on: 2008-01-10, 02:49:49 PM »
XNA is designed to compile using Visual Studio Express 2005 edition. Moreover, XNA does not use the same C# DirectX calls that were common in the 1.1 framework. So it is highly unlikely that you would be able to get them working together without some substantial work. One of the biggest problems would be the sound system. The current version of SGDK2 uses FMod for its sound support. (which I believe is a third-party sound library) XNA has its own pipeline for storing and playing back sounds, as well as its own tools for processing them. Of course, you don't have to actually use XNA's sound routines, I'm pretty sure you could create an XNA project that used FMod.

Hmmmm...I guess the first real step would be to change over most of the DirectX calls to be compatible with XNA's drawing routines. Thankfully enough, SGDK2 uses XML for its data storage. XML is vanilla. Pretty much anything can load XML data. XNA would be able to load SGDK2's stored information, no problem. I don't think you would need to port the editors over to XNA, just the game runtime. XNA is designed for game routines, not event-driven architecture. So it doesn't necessarily play nice with WinForms.

I think it is definitely worth looking into. XNA would be the easiest external platform to port it to, since they already have several things in common. (being programmed in the same language being the most significant) And SGDK2 would get a boost in features from XNA. Most notably, it would be possible to map the XBox 360 controller to your games. We're talking full analog stick support and everything, even rumble. And a lot of pixel effects and possible support for 3D rendered backgrounds. (you could use a draw-to-texture routine to map a 3D model to one of the layers)