Click to See Complete Forum and Search --> : DirectX and C#


danutz_plusplus
December 27th, 2006, 02:26 PM
Hi guys. I was wondering if anyone knows if it will ever be possible to write DirectX graphics engines with C#, and not C++? Are there any chances of this happening?

wildfrog
December 27th, 2006, 02:34 PM
Depends on what a 'DirectX graphics engine' is, but you can use use DirectX from C# and other .NET languages.

- petter

danutz_plusplus
December 28th, 2006, 02:29 AM
Depends on what a 'DirectX graphics engine' is, but you can use use DirectX from C# and other .NET languages.

- petter

Really? So you could write code and use the DirectX APIs in C#? I thought you can't because the syntax in DirectX is purely C++. And how would you go about using those APis in C#? Or do you write your DirectX code in C++ and then simply integrate the cpp file in your project? Thanks.

HanneSThEGreaT
December 29th, 2006, 05:22 AM
These might be of some use :
http://www.csharp-home.com/index/tiki-read_article.php?articleId=105

http://msdn.microsoft.com/directx/xna/faq/

http://www.c-sharpcorner.com/directx.asp

http://www.ondotnet.com/pub/a/dotnet/2003/06/02/dx9.html

http://blogs.msdn.com/tmiller/archive/2003/11/06/57522.aspx

http://msdn2.microsoft.com/en-us/ms228284(VS.80).aspx

http://www.euclideanspace.com/software/games/setup/dx9cs/introduction/index.htm

http://experts.about.com/e/d/di/directx.htm

http://www.gametutorials.com/gtstore/c-5-direct3d-tutorials.aspx

http://www.codeguru.com/csharp/.net/net_general/graphics/article.php/c11375/

http://redir.internet.com/rss/click/www.codeguru.com/csharp/csharp/cs_misc/graphicsandimages/article.php/c12445

danutz_plusplus
December 29th, 2006, 05:50 AM
Very nice links. Thanks. I do have one more question. In this (http://www.euclideanspace.com/software/games/setup/dx9cs/introduction/index.htm) link, at the bottom of the page, it says that "DirectX 9 is also known as Managed DirectX Because this is build for Managed languages.". Does this mean that DirectX 9 comes only in the managed form, and not in the unmanaged? And if DirectX 9 does come in an unmanaged form, can you program in unmanaged DirectX 9 with C#? Thanks in advance.

Zaccheus
January 5th, 2007, 06:48 PM
Looking at this FAQ (http://msdn.microsoft.com/directx/xna/faq/), it seems Managed DirectX is being phased out in favour of XNA.

HanneSThEGreaT
January 6th, 2007, 02:55 AM
Managed DirectX 1.1 Migration to the XNA Framework (http://msdn2.microsoft.com/en-us/library/bb197956.aspx)

danutz_plusplus
January 6th, 2007, 03:01 AM
Aha, so in the end they plan to have Xna and Unmanaged DirectX. I'm really curious if they will consider offering support for C++ in Xna, or will it be Xna with C# and DirectX with C++.

HanneSThEGreaT
January 6th, 2007, 03:09 AM
Perhaps in future XNA will include languages like C++ and even VB.NET, but at this stage AFAIK, only C# is supported with XNA

Zaccheus
January 6th, 2007, 06:16 AM
The XNA Framework can be used from any .net language:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1028320&SiteID=1
Note however the lack of 'content pipeline' for which you need Game Studio (Pro or Express).

I doubt XNA will ever be made available to native C++, though you can access .net code via native COM.