color one pixel

How can i color one pixel on the main window. So not a pixel of an ofImage.
I could use ofRect with a width and height of 1 pixel but this sounds not efficient speed wise.
Is there another solution?

I’d use an ofImage of dimensions 1x1 instead. It will have a single unsigned char which is what you want. Drawing it would be fast enough. It seems to me the rectangle will do more than necessary to render it.

A better approach could be having a transparent ofImage the size of your screen and use setColor(x, y, color) to paint your pixels.

thanks, smart approach!