OpenGL equivalent of SetROP2(R2_NOT)
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_NO开发者_C百科T) with zero pain.
Something like this?:
glEnable(GL_BLEND);
glBlendFunc(GL_ONE_MINUS_DST_COLOR, GL_ZERO);
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.
精彩评论