-
as seen on Stack Overflow
- Search for 'Stack Overflow'
What are some real world use cases of the following bitwise operators?
AND
XOR
NOT
OR
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Hi
Could someone translate this statement into pseudo-code (or just plain english)?
var c:uint = 0xFF << 24 | r << 16 | g << 8 | b;
>>> More
-
as seen on Game Development
- Search for 'Game Development'
I've got the following code in a shader:
// v & y are both floats
nPixel = v;
nPixel << 8;
nPixel |= y;
and this gives me the following error in compilation:
shader.fx(80,10): error X3535: Bitwise operations not supported on legacy targets.
shader.fx(92,18): ID3DXEffectCompiler::CompileEffect:…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I need to make transparency, having 2 pixels:
pixel1: {A, R, G, B} - foreground pixel
pixel2: {A, R, G, B} - background pixel
A,R,G,B are Byte values
each color is represented by byte value
now I'm calculating transparency as:
newR = pixel2_R * alpha / 255 + pixel1_R * (255 - alpha) / 255
newG…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
The challenge is to find the fastest way to determine in C/C++ the length of a c-string using bitwise operations in C.
char thestring[16];
The c-string has a max size of 16 chars and is inside a buffer
If the string is equal to 16 chars doesn't have the null byte at the end.
I am sure can be done…
>>> More