Reading from a DirectDraw buffer...

Started by
0 comments, last by Arek the Absolute 22 years, 5 months ago
Greetings! Can anyone point me to the fastest way to read a pixel off of a DirectDraw buffer? That is to say, if I wanted to find out what color the pixel at (50,100) was, what is the fastest way to do it? If I wanted to take all the pixels in a 10x10 area, and mess around with the colors, is there a fast method? The only methods I can find are cripplingly slow. I understand I''m asking a rather broad question, but anything you can offer would be greatly appreciated. Thanks- Arek the Absolute
-Arek the Absolute"The full quartet is pirates, ninjas, zombies, and robots. Create a game which involves all four, and you risk being blinded by the sheer level of coolness involved." - Superpig
Advertisement
Lock/Unlock method (and remember: if you gonna work with surface with locking of it you''d better to create it in system memory. That''s faster than use surface in video memory + locking operation!)
Or you can keep the same buffer as your DirectDraw buffer in system memory and read information from this buffer. I.å. you have two identical buffers, that keep your surface. One is visible and other is work. If you''re modifying one you must modify and other. But for reading only this way is very ;-) fast.
(f) Fisher

This topic is closed to new replies.

Advertisement