ROP with OpenGL

Hello guys!

Does anyone know a way to make ROP with OpenGL ? I was trying to do it using Windows SDK, but know I need to do the same with OpenGL, is it possible ?

Thank you for the moment

Best regards


in the opengl pipeline, you have the option to use logical operations with the fragment you are writing so you’ll probably be able to do all the ROP thing with it.

Go read the red book. Looks, on nehe’s site Look on the lower left of his web site, you’ll see a link to the electronic version of the red book.

Hello Gorg!!!

Ok I looked in the reb-book but how can I make the ROP efect ? do you have some implementation of it ???

If you can help me, I would be really happy.

Thank you for the moment

Best regards


there is a list of the binary ROP codes, I’ll give you some example :

The pen in GDI is the incoming fragment in opengl.


I don’t know how you will blit you things together, but for example if you use glCopyPixels and want to XOR to next colors with the existing color.

glEnable( GL_LOGIC_OP)
glOpCode( Gl_COPY )
glCopyPixels( firstblock)
glOpCode( GL_XOR )
glCopyPixels( secondblock )

if you use textured mapped quad, simply change the glCopyPixels with the code to write and texture your quad