Is there a way to check pixel color?

BlitzMax Forums/BlitzMax Beginners Area/Is there a way to check pixel color?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

To read a pixel from screen use code below

Local pix:Byte[4]

glReadPixels ( screenx, screeny-1, 1, 1, GL_RGB, GL_UNSIGNED_BYTE, byte ptr pix )

pix then will have r,g,b in pix[0] pix[1] and pix[2]

Or just make an array the width of the terrain and keep the heights in it for each verticle scanline then just use the x position in array to read in height.