Bitmasks

What are bitmasks and what are they good for? I looked online a bit, and it looks like they're commonly used for "flag values", but I don't see why you couldn't use an "int" or char for a flag value.

Are they something I would use often in game-programming?
I give an overflow overview and fairly in-depth explanation of how they work here:

http://www.cplusplus.com/forum/beginner/72705/#msg387899


One reason they're often beneficial is for passing an arbitrary number of options to a function. Rather than passing 30 different bool parameters, you can cram all of them into one flag parameter.
Last edited on
Topic archived. No new replies allowed.