   What is managed directx?
  Can enybody explain me What is managed directx? and what is his purpose?  
  Basically it''s just the same as normal DirectX, but it''s meant be used with managed languages (c# for example).   Business is business and Moses is Moses[Homesite]   ;  Microsoft introduced a new environment, .NET where code is compiled into an intermediate (MSIL) language, which is compiled to x86 code when the .exe is run.Several new languages were introduced, like C#, VB.net and J#. Those languages have as one of the characteristics that they are very object-oriented, use strong typing and that variables are range-checked. This makes overwriting memory by careless programming impossible.In C++ it''s easy to define an array as int x[8] and then use for(i=0;i++;i<10){} and then overwrite another variable, causing you much headache because something else mysteriously changes its value.Managed DirectX is an interface to use directx from C#, VB.net etc. And it''s a wonderful interface. Everything is now class-oriented, even the types. The code looks much cleaner and more readable, and you get a lot more done in less time.;  Watch out, managed DX with C# is about 50% slower than plain DX with C/C++. ;quote:Original post by Anonymous Poster  Watch out, managed DX with C# is about 50% slower than plain DX with C/C++.And here we go again...C# with Managed DirectX is noticeable slower than C/C++ only if it is used wrongly. That 50% is not true, I get same framerates with my game - I made it with C++ and then again with C#. That SDK''s point sprite sample is good example where c#/MDX is a lot slower, but it will be fixed with c# 2.0 I believe (and when we get OS that is meant for managed application) Business is business and Moses is Moses[Homesite]   ;quote:Original post by Miksan  quote:Original post by Anonymous Poster   Watch out, managed DX with C# is about 50% slower than plain DX with C/C++.And here we go again...C# with Managed DirectX is noticeable slower than C/C++ only if it is used wrongly. That 50% is not true, I get same framerates with my game - I made it with C++ and then again with C#. That SDK''s point sprite sample is good example where c#/MDX is a lot slower, but it will be fixed with c# 2.0 I believe (and when we get OS that is meant for managed application) Business is business and Moses is Moses[<a href="http://koti.mbnet.fi/miksan">Homesite<a/>]   you are still making the point that currently c# is slower because of certain things you stated above. ;quote:Original post by Anonymous Poster  you are still making the point that currently c# is slower because of certain things you stated above.   Yep, but I wouldn''t scare the new comers with such high numbers (50% slower), when it''s not true with every aspect of the language. I think you should say that avoid boxing/unboxing with for example particle engines. Business is business and Moses is Moses[Homesite]   ;quote:Original post by Anonymous Poster  Watch out, managed DX with C# is about 50% slower than plain DX with C/C++.   Nonsense...Especially with DirectX, where you will probably spend most time pushing things to the card and waiting for dev.present to complete, a decent programmer can make it run equally fast. If you program it like C++ and use ''new'' constantly with local scope for integers and small structs, yes then the garbage collector will occasionally have to clean up your mess. But it would take a really,really bad programmer to make it 50% slower.Some of the C# SDK demos are slightly slower. But that is mainly due to the source not being real C# but a straight conversion from C++ to C# and also because it uses application.doevents() in the main loop. ;quote:Original post by Fidelio66  also because it uses application.doevents() in the main loop.Never heard of that. Can you tell more about it and what to use instead? Business is business and Moses is Moses[Homesite]   ;  With C# being 50% slower is true "IF" the programmer doesn’t program the "game/example(s)" correctly which can be said if the programmer doesn’t program correctly using unmanaged code.  The problem that managed has over unmanaged is how types are converted (boxing/unboxing) this is the slow down that you get if you or any other programmer is being lazy.  In other words, if the programmer lets .NET manage everything then you will have a performance hit, but if the programmer takes just some control then the performance hit is not noticeable.  If you have a game made in .NET and the same game made with unmanaged C++ then the .NET version will run 2-5% slower then the unmanaged, 2% is the normal.  Just think about that for a second.  100fps on c++ and you get 98fps on .NET, you have a lot faster development time.  Also if your not careful with C++ you can take a performance hit and other bugs that will delay you for a while.So for that point spirit example the programmer let .NET manage the demo, and you get a bit hit.  If you interested in .NET I encourage you to give it a shot, there is a book out that I have, which teaches you how to use Managed DX9 using C# it was made by the development lead for Managed DirectXManaged DirectX 9 Kick Start: Graphics and Game Programminghttp://www.samspublishing.com/catalog/product.asp?product_id={1C65F6A0-8915-4458-B342-D6240CAE4273