Why do the Direct X samples use mainly c++?

J

Jack O'Lantern

Like video capture...

When you download the Direct X 9 SDK, there are like 12 samples for
progs for DirectShow in C++, but only 2 in managed languages. Can you
do everything in c# you can do in c++, in DirectX?

How does one "convert" these c++ languages to c#? I'm not as familiar
with c++ as I am with c#, and i'm not sure how I'd say "this line in
c++ would be THIS line c#" and so forth.

Thanks for any tips!

Jack
 
?

-_-

Expect that to change, but peoples perception is managed code and games =
bad. They are the same people that also should "FPS!!!" not knowing that
over 100 fps or so makes jack all difference
 
F

Frecklefoot

When you download the Direct X 9 SDK, there are like 12 samples for
progs for DirectShow in C++, but only 2 in managed languages. Can you
do everything in c# you can do in c++, in DirectX?

AFAIK, DirectShow is not supported in Managed DirectX. It is only available
for DirectX in C++, hence the language of the examples. I think you can
still use DirectShow via COM, but I've never tried it.
How does one "convert" these c++ languages to c#? I'm not as familiar
with c++ as I am with c#, and i'm not sure how I'd say "this line in
c++ would be THIS line c#" and so forth.

Though C++ syntax is very similar to C# syntax (with the exception of
pointers), C# has many .NET classes that C++ doesn't have. So converting
between the two may require knowledge of both languages so you can choose
the best implementation strategy when converting. Going from C++ to C# may
be easier than going the other direction unless the C++ code is doing a lot
of direct memory access. But like I said, DirectShow isn't even available
in Managed DirectX.

There is one way you could get access to DirectShow (sort of), but it
requires knowledge of C++, so I won't go into details. Depending on
details, it could be really easy to access from C#.

Is this a personal project or a professional one?
 
H

Harry Bosch

Like video capture...

When you download the Direct X 9 SDK, there are like 12 samples for
progs for DirectShow in C++, but only 2 in managed languages. Can you
do everything in c# you can do in c++, in DirectX?

How does one "convert" these c++ languages to c#? I'm not as familiar
with c++ as I am with c#, and i'm not sure how I'd say "this line in
c++ would be THIS line c#" and so forth.

The main thing with DirectShow (and the rest of DirectX, I assume) is the
COM interfaces you have to deal with. They are bad enough in C++, so if
you could use COM Interop with C# you might be a lot better off. You'll
need to hit the books/docs on COM interop, but I imagine it is doable.

I'm currently on a project using DirectShow to do video capture, but
since the requirements are that it be done in C++, I haven't looked into
using C# or any of the other .NET facilities. Do a search on
www.codeproject.com, however -- I think I recall someone posting an
article about this topic, and how to get the COM interfaces set up for
use with a .NET language (I could be wrong, and, if so, apologies in
advance).

Also, there are some sharp DirectShow guys on
microsoft.public.win32.programmer.directx.video, which could be helpful.
 
J

Jack O'Lantern

Thanks for all the suggestions, guys. I will research the COM interop ideas....


Jack
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top