GetPixel() Alternative

Started by
2 comments, last by AquinasProtocal 20 years, 8 months ago
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
Advertisement
Try looking at http://www.drunkenhyena.com/docs/d3d8/dhGrayScale.phtml

It should put you on the right track
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
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

This topic is closed to new replies.

Advertisement