PDA

View Full Version : ROP with OpenGL



KurtCob
08-25-2000, 06:59 AM
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

Kurt

Gorg
08-25-2000, 06:50 PM
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 nehe.gamedev.net. Look on the lower left of his web site, you'll see a link to the electronic version of the red book.

KurtCob
08-26-2000, 01:35 AM
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. http://www.opengl.org/discussion_boards/ubb/smile.gif

Thank you for the moment

Best regards

Kurt

Gorg
08-26-2000, 08:36 AM
http://msdn.microsoft.com/library/default.asp?URL=/library/psdk/gdi/pantdraw_73jn.htm

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.

R2_BLACK --> GL_CLEAR
R2_COPYPEN --> GL_COPY
R2_XORPEN --> GL_XOR
R2_MERGEPENNOT --> GL_OR_REVERSE

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