🎉 Celebrating 25 Years of GameDev.net! 🎉

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!

Get rid of GetDC

Started by
4 comments, last by kmsixpence 22 years, 8 months ago
I''ve been wanting to get the color of the positon of which the mouse is on with DirectX7. I have it on a directdraw surface and I''ve been using GetDC and ReleaseDC with the surface along with GetPixel to find the pixel color. I was wondering if there''s anyother way to do it. Maybe by locking the surface or something because I know this isn''t very fast.
Advertisement
Please, anyone? I really need to know this fast.
Don''t know much detail about how directdraw surfaces work.

If it were a bimap, maybe get the x,y pos of the mouse and the width,height of your surface. Use those to calculate an offset then get the information from the buffer where the bitmap data is stored.
But thats my whole question, how do i get it from the buffer or whatever it is stored.
Lock the surface with ->Lock() and then just read the byte (or bytes if more than 8 bpp).
Ahhh, but thats the problem, how do i read the bytes...

This topic is closed to new replies.

Advertisement