views:

38

answers:

2

Considering QGLWidget (or OpenGL in general), what can be the easiest solution to draw pixels in the inverse color of the screen / frame buffer? In Win32 / MFC environment, I used to use the SetROP2(R2_NOT) with zero pain.

A: 

I'm not sure what that function does, but you surely can do it with shaders, and they're HW accelerated.

Related, you can use glLogicOp, BUT, that function is usually NOT HW accelerated, so shaders are preferred.

Matias Valdenegro
+1  A: 

Something like this?:

glEnable(GL_BLEND);
glBlendFunc(GL_ONE_MINUS_DST_COLOR, GL_ZERO);
genpfault