Click here to Skip to main content
15,884,388 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello,
We had an application that used DirectDraw for drawing many pixels directly to the video memory at a high rate.
As there is no more MS support for DirectDraw, we want to refresh this code.

Does anyone any suggestion what is the best replacement? Direct2D? Dierct3D? DIB?
We are in native code...
Thanks to you all!
Posted
Updated 8-May-11 1:16am
v2

1 solution

How can Direct2D and Direct3D can be alternative to each other? (Yes, I would recommend usign Direct2D and/or Direct3D.) It depends on character of graphics you want to create. Of course you can always model 3D objects and render them as 2D projections; depending on the problem, it may or may not be simpler and faster. To compare performance you need to try your approaches on graphic tasks specific to your application. DIB? I don't think it is a separate technology alternative to something else; how can you "choose" it?

—SA
 
Share this answer
 
Comments
ronhash 10-May-11 14:16pm    
The graphics we need to create are at the pixel level, this is why DirectDraw was sucha good solution a while back. From what I see around Direct2D is rather new, and there are not too many resources, samples and tutorials, and I'm afraid that microsoft for pull the plug on it, as they did with DirectDraw.
When I'm talking about DIB, I was just thinking of creating a bitmap, (DIB) fill it with my pixels in a background thread, and then blting it - it's not a technology, but a technique...
Sergey Alexandrovich Kryukov 10-May-11 21:11pm    
It's hard to predict where Microsoft will pull a plug, really. Microsoft (or part of it) is doing significant effort to discontinue Windows line by developing of the platforms based on pure CLI (.NET) right on top of Hardware and Hardware Abstraction Layer. I would welcome it very much. In graphic I personally press on WPF. I understand about DIB; you can use it as a buffer, but is you write on it using GDI+..? or direct bit manipulation? Can also be a performance problem...
--SA
ronhash 11-May-11 7:34am    
What I thought with DIBSection what just transparent blting it only to my existing GDI DC (not GDI+).

This is an existing product written in C++ and Win32, and we do not plan for now to convert all of it, just to refresh this small part that is doing this pixel drawing.

I though that just turning pixels on & off would be something simple, but I guess it's not.
I'm sure I will have to experiment with the subject, I was just wondering if you (or anybody else) had experience with this kind of fun...
Sergey Alexandrovich Kryukov 11-May-11 15:48pm    
I did with either GDI/GDI+ or WPF, but most recently with .NET. In all cases you need to pin image to memory to work with pointers and use fast massive operations to exchange between your buffer and video memory. It's really fast with DirectX if it supported by hardware and much slower with GDI.

By the way, this is another (more serious) argument in favor of DirectX -- it's supported by hardware. It's not easy to pull the plug...
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900