in drawing mode 2 it says current "all graphics are XOR'ed with current background"
right now i not sure what that means and how it will look when it draw
quick question
quick question
~Dreglor
-
Codemonger
- Enthusiast

- Posts: 384
- Joined: Sat May 24, 2003 8:02 pm
- Location: Canada
- Contact:
When you redraw an XOR image onto itself, the outcome is it returns the pixels to their original state. So you can draw an image XOR onto something and then redraw the image using XOR and effectively putting the pixels back to normal. This is what your mouse uses, I think ?
<br>"I deliver Justice, not Mercy"
    - Codemonger, 2004 A.D.
    - Codemonger, 2004 A.D.
-
freedimension
- Enthusiast

- Posts: 613
- Joined: Tue May 06, 2003 2:50 pm
- Location: Germany
- Contact:
Now, all XOR does is set a bit where only one bit was set, either in the first or in the second input.
See this table
Now an example:
So when drawing exactly the same twice in XOR Mode, it looks like nothing has been done at all.
Edit: This is widely used, for example in drawing rubberbands (selection boxes) in nonbuffered gfx applications (with the widespread of newer Graphiccards there's no point in doing this anymore) and if you want to draw something that should be visible in 99% of all cases, no matter what background you use. A Box, for example, would look black on a white background and white on a black one. Only problem here, when you have a middle grey near rgb(128,128,128) you would see almost nothing.
See this table
Code: Select all
| 0 1
---------
0 | 0 1
1 | 1 0Code: Select all
10110111 XOR
11011101 <- we will use this one again
-----------
01101010 Result
01101010 XOR <- The Result from above
11011101 <- With the second input from above
-----------
10110111 <- Results in the first input from aboveEdit: This is widely used, for example in drawing rubberbands (selection boxes) in nonbuffered gfx applications (with the widespread of newer Graphiccards there's no point in doing this anymore) and if you want to draw something that should be visible in 99% of all cases, no matter what background you use. A Box, for example, would look black on a white background and white on a black one. Only problem here, when you have a middle grey near rgb(128,128,128) you would see almost nothing.