(Math)Texture Flags from a number

Blitz3D Forums/Blitz3D Programming/(Math)Texture Flags from a number

Boolean - Quick Primer
AND
A	B	Output = true(1) only if BOTH of the inputs are true
0	0	0
0	1	0
1	0	0
1	1	1

OR
A	B	Output = true(1) if either of the inputs are true
0	0	0
0	1	1
1	0	1
1	1	1

XOR
A	B	Output = true(1) only if either of the inputs are true, but not if BOTH are true
0	0	0
0	1	1
1	0	1
1	1	0


NAND (Not AND)
A	B	Output = false(0) only if BOTH of the inputs are true(1)
0	0	1
0	1	1
1	0	1
1	1	0

NOR (Not OR)
A	B	Output = true(1) only if BOTH of the inputs are false(0)
0	0	1
0	1	0
1	0	0
1	1	0

NOT
A	Output = opposite of input
0	1
1	0

Binary Shifts - just take the bits and shift them left or right the specified number of places
1024	512	256	128	64	32	16	8	4	2	1 = value of bits
----------------------------------------------------------------------------------------------------------------------------------------------
0	0	0	0	0	0	0	1	0	1	1  = 11
0	0	0	0	0	1	0	1	1	0	0  =  44 (11 shl 2)
0	0	0	1	0	1	0	0	0	0	0  =  160
0	0	0	0	0	1	0	1	0	0	0  =   40  (160 shr 2)