Direct3D or DirectDraw

Started by
11 comments, last by zangetsu 18 years, 4 months ago
For a fair comparison I did up something similar in Managed DirectDraw on the same machine (Radeon X800 Pro) just to see how much the video card was playing into it.

Fullscreen 640x480x32, drawing the first of the 6 (100x101, the smallest sprite) without alpha blending 256 times per frame, gives 550 fps. Conclusion: Modern video cards are not optimized (or rather the drivers are not) for fast DirectDraw. Unless you are targeting much earlier hardware, Direct3D to display 2D would be the best choice.
Advertisement
To the people who have said that it's quite slow and or shows graphical artifacts, that was quite a while ago when that truely was the case. I've been using the Sprite class a lot lately, and can say it is far from slow, and doesn't show artifacts. Infact, it's less prone to texture artifacts than manually doing it yourself. I know if I used very small textures and stretched them horizontally a lot when I used to use my own textured quads, the texture could lose alignment slightly and really throw off the look of say a window border for a UI, etc.

In short, the sprite class is quite fast now.
Quote:Original post by Wurmknight
@Zangetsu:
I appreciate the link and I plan on looking over the site better when I get home (at work right now). I am curious though, and this is directed at anyone who can answer this. On your tutorial, you have a function (sub-routine i guess in VB) that disposes the D3D device.. In managed C#, wouldn't it dispose itself when the 'form' was destroyed/closed, because it is a member variable of that class. I could be thinking wrong, so that is why i'm so curious about this. I'm sure disposing it really doesn't hinder anything but I am curious if this step even needs to be called.


Well I won't claim to be an expert, but I suspect that even though the code uses "Managed" DirectX, that somewhere underneath it all, it calls Bill only knows what unmanaged code. The other thing that is curious is that the objects even have a dispose method. You right that in theory when the garbage collector clears the object it should dispose itself. If it does dispose itself, why go through the trouble to add the dispose method to this implementation? I also suspect that the garbage collector may not be able to recover video memory like it does system memory. I think for the real answer we would need to consult the DirectX Docs, and if the answer isn't there, then ask the DX dev team itself. As for me until I get a better answer; If it has a Dispose method, I call it when I am done.

This topic is closed to new replies.

Advertisement