I have hard time to understand why to use Bitwise operations in enum's and then in the code . why not using just numbers or boolean's for example :
enum
{
RS_BLEND = (1 << 0),
RS_BLEND_FUNC = (1 << 1),
RS_CULL_FACE = (1 << 2),
RS_DEPTH_TEST = (1 << 3),
RS_DEPTH_WRITE = (1 << 4),
RS_DEPTH_FUNC = (1 << 5),
RS_CULL_FACE_SIDE = (1 << 6),
// RS_STENCIL_TEST = (1 << 7),
// RS_STENCIL_WRITE = (1 << 8),
// RS_STENCIL_FUNC = (1 << 9),
// RS_STENCIL_OP = (1 << 10),
RS_FRONT_FACE = (1 << 11),
RS_ALL_ONES = 0xFFFFFFFF,
};
void RenderState::StateBlock::setCullFace(bool enabled)
{
_cullFaceEnabled = enabled;
if (!enabled)
{
_bits &= ~RS_CULL_FACE;
}
else
{
_bits |= RS_CULL_FACE;
}
}
this is not critical or embedded software .