Hi,
As a relative newcomer to OpenGL I have a question which I’m struggling to find a definitive answer for - maybe you guys can help me please ?
I’m developing an application where I am blitting 2D, rectangular pixel arrays from one context to another, and I want to perform logical operations on the pixels as they are transferred. I’ve found the glLogicOp() function, in conjunction with the XOR operation, which seems to do the trick.
If I blit an array of (source) pixels onto an array of pre-existing, and different, (destination) pixels, using the XOR logical operation, I would expect the resulting pixel array to be dissimilar to both the original source and destination arrays. If the source and destination arrays are the same I would expect the resulting array to be empty i.e. full of ‘blank’ pixels.
My question is, is there a way to detect what the result of that XOR operation is ? In other words can I tell whether the resulting pixel array is empty or not ?
Ideally, this should be a fast test. The pixel arrays may be large, and the test has to be done frequently, so checking every pixel individually would not be a good solution.
Any suggestions you can make would be greatly appreciated.
Smeg