Sarbojit Sarkar wrote:
I got to know that DirectDraw APIs are being used for all drawing
operations and they are faster and specialized for drawing operations
only.
That statement contains three assertions, and all of them are wrong.
DirectDraw is NOT used for all drawing operations. DirectDraw is an old
technology (circa 1994) that basically provides access to offscreen
surfaces and overlays. As an accident, it also allowed you to get a
pointer to the primary surface.
DirectDraw is now obsolete. Are you, perhaps, thinking of Direct3D?
WDDM is all about Direct3D. The fancy desktop effects in Vista and Win
7 are all thanks to Direct3D.
Currently my requirement is to capture primary screen and send it to a
remote system.
I don’t understand the incredible flurry of activity by people trying to
reinvent this particular wheel. Are you aware that there are quite
literally dozens of excellent products available today that do EXACTLY
THIS, some of them with 15 years of maturity behind them? This problem
has been solved. Time to move on.
I have done it using GDI calls but I wanted to know can we do the same
using DirectDraw? If yes, which one will be faster and advisable?
It is possible for you to use DirectDraw to get a pointer to the
“primary surface” and copy the pixels directly from the frame buffer.
In that case, you have the responsibility to understand the format of
the primary surface and convert it to the format you need. With GDI,
that’s done for you.
“Faster” is a matter of some debate. Reading from the frame buffer is
never quick, no matter who’s doing it. That’s not the important
direction, so hardware manufacturers spend no time optimizing that
direction. Plus, there’s a lot of data. A 1280x1024 screen is more
than 5 megabytes. With many graphics devices, it can take 100
milliseconds just to transfer that much.
Have you looked at the source for VNC or any of its derivatives? They
use a number of different methods for reading the screen image
(including GDI, DDraw, and mirror driver), depending on circumstances.
I was reading some quick references, where I found using DirectDraw I
can compress the data as well, also DirectDraw is at the app level
only (Please correct me if I am wrong.).
DirectDraw does not do compression. If there is to be compression,
you’ll have to do it. DirectDraw is called from applications, but it
calls into the kernel display driver to do its work.
Is it possible to use DirectDraw without actual
hardware(graphics accelerator)?
No. The user-mode DirectDraw layer is merely a thin adapter plate that
calls interfaces in the display driver. It is the display driver that
provides ALL of the functionality. Unlike most other APIs, there is no
emulation. If the display driver does not provide DirectDraw, then you
cannot use DirectDraw.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.