[video output=day017 member=cmuratori stream_platform=twitch stream_username=handmade_hero project=code title="Unified Keyboard and Gamepad Input" vod_platform=youtube id=WDB718JId4M annotator=garlandobloom] [2:19][Overview of the previous day's work] [5:11][An introduction to functional programming] [10:44][Methods for making our programs more functional] [11:41][Rationale for moving keyboard handling out of Win32MainWindowCallback()] [14:37][Finishing the keyboard processing code] [15:55][Adding a fifth controller (the keyboard)] [17:00][Adding 32-bit and 64-bit compiler options to the build.bat] [19:54][Ensuring keyboard state persists across frames] [22:35][An Assert() that we didn't do anything stupid] [23:50][Finishing our directional stick code with deadzone processing, no zombies.] [29:36][Using the deadzone values from MSDN] [35:05][Iterating across all the controllers in GameUpdateAndRender()] [36:23][Testing new input code] [37:34][Changing game_controller_input to work across both keyboard and gamepad] [41:12][Adapting the keyboard and gamepad code to the new structure] [44:55][Connecting the stick input into a fake directional pad] [48:16][Hooking up the real DPad] [52:05][Adding an IsConnected member to game_controller_input] [53:07][Buffer Overrun encourages some bounds checking] [56:44][Why did we overrun the buffer?] [59:26][Adding some last minute keyboard inputs] [1:00:06][Final Thoughts] [1:02:28][Q&A][:speech] [1:02:50][Check the array in the Buttons union, you might want 12 now that you've added start and back] [1:08:54][Is that some copypasta, or is it really supposed to be all MoveLefts?] [1:11:24][Could it be good to apply some integration on the keys, so we don't just set the value to binary -1/1?] [1:12:56][Can you talk about the deadzone being round vs rectangular at hardware USB, HID, and XInput API layers?] [1:19:15][Maybe it's a round deadzone?] [1:23:40][I'm 16 days behind, is there a better way to catch up than watching all the days on YouTube?] [1:24:22][For the build.bat, you can build for Windows XP 64-bit using 5.2 instead of 5.1] [1:24:33][On the inline method for GetController(), what happens if you pass in -1 for index?] [1:25:50][Can you do struct buttons_type (name the structure) and still get the benefits..?] [1:26:39][I don't get using Win32 prefix for function names when compiling for 64-bit.] [1:27:34][I was thinking about processing game input in a separate thread so it is framerate independent, but I heard you could introduce input lag. Is that true?] [1:28:46][You said a circular deadzone would be good for gameplay, why don't you just make it circular? The deadzone would just be a little bit bigger.] [1:32:02][DirectInput vs XInput, which is better?] [1:33:17][You deleted the Min/Max macro TODO...] [1:34:03][So when you use the ZeroController, why not just go *NewKeyboardController = {}?] [1:35:29][stddef should include offsetof(), you can use that to make your assert a little simpler.] [1:37:56][Final Wrap-Up][:speech] [/video]