Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

AquinasProtocal

GetPixel() Alternative

This topic is 5530 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I want to be able to get access to the colour of a pixel in a texture in order to calculate collision detection, many of the posts i have read on this topic seem to be theory and say little about actual implementation. All I want to know is a single function that will return a value depending on the colour of a pixel at a certain point i.e. GetPixel(x,y). I don''t use an HDC in my game in order to use GetPixel(HDC,x,y). Is there a Direct3D equivalent to this function? or a different gdi function that doesn''t want an HDC? All the best, Hugh

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
keep a copy of the texture or and on/off bitmask around in normal system memory, and use it to check.. reading stuff from the video card, such as textures, is SLOW

Share this post


Link to post
Share on other sites
Thanks very much,

That was very useful, i managed to get access to each pixel and find what colour it was, it is slow, but used sparingly, it works fine.

Thanks,

Hugh

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!