First: 16 == 0x0010, so start button Second: 68 == 0x0044 so dpad left and left thumb The second one is false, only the first comparison is true
XOR operator, so buttonChanges is 0b0000’0100 – it is the dpad left that now has been pressed buttonsPressedThisFrame is 0b0000’0100 buttonsReleasedThisFrame is 0b0000’0000 want 0b0000’0100 & 0b1110’1011 2nd case buttonsReleasedThisFrame is 0b0000’0001 want 0b0000’0101 & 0b1110’1011
ISR - Interrupt service routine Default message loop of a windows desktop application. GetMessage is blocking until a message is received
= loop of SDL – non blocking
What are the problems with this piece of code? Better to use a switch – correct, but irrelevant What if we want the user to configure the mapping? Could use function pointers/functors/lambda’s
Looks a lot like a functor, which could be a valid implementation!