possible to get color of a single pixel in 2d?

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
darthneo
Posts: 6
Joined: Mon Jan 01, 2007 6:35 pm
Location: A Box, USA

possible to get color of a single pixel in 2d?

Post by darthneo »

Hello, I'm trying to make just a simple game where if your mouse goes outside of a maze something happens... is there a way to get the color thats under your mouse?
porcus
Posts: 149
Joined: Sun May 27, 2007 6:24 pm
Location: Germany

Post by porcus »

You could create a screenshot, but I guess this would be very slow:

driver->createScreenShot()

http://irrlicht.sourceforge.net/docu/cl ... 715ef36dbe
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

It's generally not a good idea to get data back from your graphics card, it's very slow.
If you load your maze as an image from a file, try loading it manually as an IImage (image in system memory) then create a texture from it manually. Query the image in system memory using getPixel.
If you're creating your maze in 3D then you should solve this problem in 3D using triangle selectors and not worry about what actually gets drawn.
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
Post Reply