easy way:
HDC dc;
lpddsPrimary->GetDC(&dc);
color = GetPixel(dc,x,y);
lpddsPrimary->ReleaseDC(dc); //don't forget
otherwise, if you really dislike GDI, Lock the surface and read it directly. should be in the docs.
Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!
otherwise, if you really dislike GDI, Lock the surface and read it directly. should be in the docs.
The best method would be to lock the surface, then do *ALL* of your pixel reading, then unlock the surface.
Locking and Unlocking are still pretty slow, so you want to use it as least as possible, so only and the begining and end.
this is how I learned. (and you don't even have to leave this website)