Archived

This topic is now archived and is closed to further replies.

C# and DirectX

This topic is 5885 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello All, I was wondering if anyone has played with C# much, and if so has anyone tried to do anything with DirectX?

Share this post


Link to post
Share on other sites
DirectX wont be officially supported in C# until DX9, which comes with Managed DX. You can get DX8 to work by messing about with P/Invoke on the VB dll''s, I believe. You can probably find some info about this if you search the MS .NET newsgroups(microsoft.public.dotnet.*).
There is also an OpenGL wrapper for C# being made(GLUT and SDL is in the works, I think) Look here

Psalm 137:9: "Happy shall he be, that taketh and dasheth thy little ones against the stones."

Share this post


Link to post
Share on other sites
Thanks Arlid.

Excuse my lack of knowledge about C#, but I recall reading something about being able to take com compontents and compile then into a .net dll, which then is usable like any other .net dll.
Here is that article.



Share this post


Link to post
Share on other sites
Yeah, I sort of knew about that, although I''ve never actually used it. Visual Studio.NET can automatically import COM components and make a .NET wrapper class for you. I wouldnt be surprised if you could find premade wrappers for DX8 out there somewhere(google is your friend )


Psalm 137:9: "Happy shall he be, that taketh and dasheth thy little ones against the stones."

Share this post


Link to post
Share on other sites
Oh Yes Google has saved my hide on many occasions.
VS.NET had under its com references a DX for VB.

I tried that last night. It worked for the most part.

I think I shall see if I cant get a beta of DX9 though.

And, sorry for screwing up your name last post


Share this post


Link to post
Share on other sites
I do believe they arent taking any more applications for the DX9 beta program.

Psalm 137:9: "Happy shall he be, that taketh and dasheth thy little ones against the stones."

Share this post


Link to post
Share on other sites
I do believe (actually know) your correct.
I did however sign up for the beta a little over a month ago.

Also I still have one or two friends that work there

Share this post


Link to post
Share on other sites
C# is a brand new language (Microsoft calls it Visual Studio .NET), a mixture of QBasic and C. You don''t have to initialize any variables, and malloc does only sizes to 32 kB. It''s great for 3D games like Unreal2, and I use it from now on. It''s really astounding.

Kneelz

Share this post


Link to post
Share on other sites
Actally C# is MS's new Language build for their new framework the .NET. Visual Studio.NET is just their next iteration of Visual Studio that supports .NET and therefor C#. It also supports development of C++ (Managed and Unmanaged), VB.NET, ASP.NET, and Web Services. To name but afew.

As to the orgins of C# and where MS got there motivation, I dont feel as I am qualified to answer that. Although I would have to agree with you Kneelz, it feels like a mixture of QBasic and C, with some of the 'good' from java thrown in too.

Since my original post I have converted the DirectX VB Tutorial application to C#. Im finding many hoops that need to be jumped through for creating simple DX apps. But for the most part its relatively easy. I have also been looking into GDI+. Though not nearly as feature rich as DirectX, it does have some cool features, like Matrix support, and Transformations. Which I will say mean not awhole too me as I am a server-side app developer and have not actually worked with 3D yet, other than reading about it.

Edited by - thurk on November 22, 2001 9:22:06 AM

Share this post


Link to post
Share on other sites
somewere on this site www.sunlightd.com is a directx.net tutorial. It might be of instest for someone.

Share this post


Link to post
Share on other sites
I''m curios how fast C# DirectX will be, though. I use C# at little at work and it is seriously slower than C++--garbage collectors have that effect.

Share this post


Link to post
Share on other sites
I''m curios how fast C# DirectX will be, though. I use C# a little at work and it is seriously slower than C++--garbage collectors have that effect.

Share this post


Link to post
Share on other sites
GameGod the tutorials at Sunlightd are for Managed C++ code, at least the ones Im thinking of are. I was interested in pure C# (Not so much managed C++).

I can''t say much on the speed comparisions of C# compared to C++ other than C++ should for the most part be faster.

As for C# and DirectX I did get it working. I used the VB libs which worked ok. The VB Examples can be fairly easily converted to C#.

I did decide to stick with C++ though.

Share this post


Link to post
Share on other sites