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.
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)