Archived

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

zbarrier1

C++ and Managed DirectX

Recommended Posts

zbarrier1    122
Has anyone created a small demo using C++ and managed DirectX? What are you thoughts about performance, etc.? Would you recommend an advanced DirectX8.1 programmer to use Managed DirectX in their next engine (yes, i know the documentation is lacking at the moment)? Any advice would be much appreciated. Also, what are your thoughts on managed C++? I hope those of you with experience can help out. Thanks in advance, Zach

Share this post


Link to post
Share on other sites
jasonsa    384
I'm a biased source, but I say you can write code to make a managed DirectX app run as fast or faster than a C++ DirectX app. The problem is that you'll need to know how to do optimizations on your managed code if you want the same perf+, and these optimization aren't the exact same ones you'd normally do for C++ since your dealing with a virtual machine. Many of the optimzations are true of high perf managed code in general.

However, apps using managed DirectX have lots of pros and even with unoptimized code the pref is pretty good. I think it's worth checking into especially for tools or quick prototyping.

And we're working on the lack of good managed DirectX docs

Jason,
DirectX SDK developer
“This posting is provided "AS IS" with no warranties, and confers no rights.”

[edited by - jasonsa on March 20, 2003 6:08:54 AM]

Share this post


Link to post
Share on other sites
Pseudo    100
I dont know if it''s any help to you, but I have a few C# dx9 projects (will source and exe) on my web space if you want to check them out.

www.msu.edu/~furtwan1

They probably aren''t good examples of best practices because I''m still learning C#, but at least you could get an idea of how easy it makes DX and how little performance impact you get. I recomend looking at the feedback first because it''s newer and easier to understand.

Share this post


Link to post
Share on other sites
Rob Loach    1504
I''m still experimenting with both, but to my knowledge, you have more direct control with C++ than C#. I don''t know whether it is faster though.

_____________________________

- Rob Loach
Current Project(s): Upgrade to .NET and learn DX 9

Share this post


Link to post
Share on other sites
IFooBar    906
Managed DirectX is DirectX that does all the grabage collecting for you. Like with C++ you have to release all the memory calling Release() functions (for DirectX stuff). When it''s managed you dont need to worry about managing memory yourself, cause it''s already managed (!)

I wouldnt know about managed C++. But C# is actually quite easy to work with. I''m actually in the middle of trying to figure out how to make a linked list cause there are no pointers in C#

I dont think managed would be faster then unmanaged. Becuase with normal C++ you have full control over how memory is used. If you''re good at it, then you can probably outperform managed stuff. BUT when you do the sam thing in managed, you finish it quicker and you have more time to spen on stuff like vertex buffer optimizations and stuff.


:::: [ Triple Buffer V2.0 ] ::::

Share this post


Link to post
Share on other sites
Arild Fines    968
quote:
Original post by IFooBar
I''m actually in the middle of trying to figure out how to make a linked list cause there are no pointers in C#


  
class Node
{
public Node Next;
public object Data;
}


is equivalent to the following in C++:

  
struct Node
{
Node* next;
void* Data;
};


Remember, class objects are allocated on the heap, not the stack, by default.



"If there is a God, he is a malign thug."
-- Mark Twain

Share this post


Link to post
Share on other sites