Re: C# vs C++ regarding DirectX

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Fabian Schmied (REMOVETHISfabianDOTschmied_at_fhs-hagenbergDOTacDOTat)
Date: 11/25/04


Date: Thu, 25 Nov 2004 09:45:33 +0100


> if you want to build applications with .NET DirectX, is it adviced to
> use C#
> or managed C++? Speed ( frame rate ) is not the most important factor.
> Are
> there any disadvantages with C# and DirectX?

There will not be much difference in speed when you compare different .NET
languages. Sure, one compiler could expose CLR features another language
doesn't, one compiler could be a better optimizer than the other (although
most optimization is done by the JIT compiler anyway), but actually, the
C# and mC++ compiler will probably produce programs of similar performance.

To decide whether to use C# or managed C++, I'd consider the following:
- Managed C++ makes interop with unmanaged code a breeze. Use this if you
have an unmanaged code base you need to use or if you need to go to the
unmanaged world often (but be careful to reduce managed/unmanaged
transitions since those are costly). Interop with unmanaged DirectX is
possible without much pain if you need it. Also note that the next version
of managed C++ will be very different.
- C# is a much cleaner language (because it doesn't mix managed and
unmanaged code). Might be that you are much more productive using C#,
simply because the syntax is more user-friendly. Use this if you want to
create a purely managed application.

Fabian



Relevant Pages

  • Re: Dec2006 SDK has dropped support for ps_1_x ?!?!
    ... Publish APIs in "machine-readable" form, ... This not only applies to DirectX, ... | The compiler may optimize these to dp2add instructions. ... float a = in.a*in.c.x; ...
    (microsoft.public.win32.programmer.directx.graphics)
  • Re: Buffer Overflow Errors
    ... Maybe if you have a compiler you ... >> Or perhaps using arrays in unmanaged code. ... >> Tony Morris ... the unsafe keyword does a lot more than that. ...
    (comp.lang.java.programmer)
  • Re: Is Visual C++.NET also a reugular compiler?
    ... windows machine, and I specifically enjoy programming graphics for windows ... using DirectX, i figure VC is still my best bet, compliance issues and all. ... work right with a non-MS compiler) on some other more compliant compiler, ...
    (microsoft.public.vc.language)
  • Re: Dec2006 SDK has dropped support for ps_1_x ?!?!
    ... Obviously the fact that the new compiler does not support pixel shader 1.x ... to anyone who read the release notes for the DirectX SDK. ... Since we moved to a bi-monthly SDK release cycle starting with the October ...
    (microsoft.public.win32.programmer.directx.graphics)
  • Re: (Complete noob) Second test failed (identifier not found)
    ... I am again trying more code from this book "Beginning DirectX 9". ... not found by compiler. ... I have tried moving the routines around a little and can generate alot more ...
    (microsoft.public.vc.language)